Grokking React Native
0% completed
Creating Reusable Components
A shopping app can easily show an "Add to Cart" button on 20 different parts of its screens. If each one has its own copy of the code, then a change to the wording means 20 edits, and a missed copy means that the app looks inconsistent. A reusable component replaces those copies with one definition that every screen uses.
The benefits follow from having one definition. You write the code once, and an update in that one place appears everywhere the component is used. The files that use it stay shorter, and every button looks and behaves the same way.
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%