5 min read
•Question 32 of 48hardHigher-Order Components (HOC)
Reusing component logic with HOCs.
What is a HOC?
A Higher-Order Component is a function that takes a component and returns a new enhanced component.
Common Use Cases
- Authentication checks
- Logging/analytics
- Loading states
- Feature flags
Note: Hooks have replaced many HOC use cases.