Container and Presentational pattern
In the last chapter, we saw how to take a coupled component and make it reusable step by step.
In this section, we will see how to apply a similar pattern to our components to make them more clean and maintainable.
React components typically contain a mix of logic and presentation.
By logic, we refer to anything that is unrelated to the UI, such as API calls, data manipulation, and event handlers.
The presentation is, instead, the part inside the render method where we create the elements to be displayed on the UI.
In React, there is a simple and powerful pattern, known as Container and Presentational, which we can apply when creating components that help us to separate those two concerns.
Creating well-defined boundaries between logic and presentation not only makes components more reusable, but it provides many other benefits, which you will learn about in this section.
Again, one of the best ways to learn new concepts is by seeing practical examples, so let...