Practice
A higher-order component ( HOC ) is a function that takes a component and returns a new component. In essence it is a pattern that follows from React's compositional nature.
We call them pure components, because they can accept any dynamically provided child components, but they will not modify or copy any behaviour from their input components.
const EnhancedComponent = higherOrderComponent(WrappedComponent)
A HOC can be used for many use cases:
Comments