Crafting Reusable Components
The aim of this chapter is to show you how to implement React components that serve more than just one purpose. After reading this chapter, you’ll feel confident about how to compose application features.
The chapter starts with a brief look at HTML elements and how they work in terms of helping to implement features versus having a high level of utility. Then, you’ll see the implementation of a monolithic component and discover the issues that it will cause down the road. The next section is devoted to re-implementing the monolithic component in such a way that the feature is composed of smaller components.
Finally, the chapter ends with a discussion of rendering trees of React components and gives you some tips on how to avoid introducing too much complexity as a result of decomposing components. I’ll close the final section by reiterating the concept of high-level feature components versus utility components.
The following...