Mantra: Keep the Unit Small
As applications grow in size, they grow more difficult for humans to understand as a whole. That’s unavoidable. However, there’s also a tendency for individual parts of the codebase to become more difficult to reconcile with one another, for indirect and implicit connections to be created that go unnoticed until they’re accidentally corrupted, causing bugs. And that tendency is avoidable. You can be vigilant about keeping each module small enough for its purpose to come across clearly. In testing terms: “Keep the unit small.”
In this chapter, you learned an important technique for keeping React components compact and purposeful: splitting layers of functionality into higher-order components (HOCs). You turned what ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access