Chapter 4. Compose All the Things
In the previous chapter, we saw how to create reusable components with a clean interface. Now, it is time to learn how to make those components communicate with each other effectively.
React is so powerful because it lets you build complex applications composing small, testable, and maintainable components. Applying this paradigm, you can take control of every single part of the application.
In this chapter, we will go through some of the most popular composition patterns and tools.
We will see the following:
- How components communicate with each other using props and children
- The Container and Presentational pattern and how it can make our code more maintainable
- The problem mixins tried to solve and why they failed
- What HoCs are and how we can structure our applications in a better way, thanks to them
- The recompose library with its ready-made functions
- How we can interact with the context and avoid coupling our components to it
- What is the Function...