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 ...

Get React Design Patterns and Best Practices now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.