Higher-Order Components
Learn how higher-order components work and how to make them.
We'll cover the following...
Refactoring with higher-order components
The power of React is that it allows you to express web apps in individual units called components. But the rules for assigning different bits of functionality to different components aren’t always clear. In principle, any React app could be expressed as a single monolithic component. Or, at the opposite extreme, every DOM element in the page could be managed by its own micro-component.
A good rule of thumb is that components should be built so that each component has only one job. Components with multiple responsibilities are a good candidate for ...