Compose All the Things

In the previous chapter (Chapter 3, Create Truly Reusable Components), we saw how to create reusable components with a clean interface. Now, it's time to learn how to make those components communicate with each other effectively.

React is 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 cover the following topics:

  • 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 the function of the child component pattern is and what its benefits are

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.141.47.221