What are Higher-Order Components (HoCs) in React?

Photo by Lautaro Andreani on Unsplash

Short Answer: Component Factories.

Longer answer?

Higher-Order Components are actually a design pattern derived from the compositional nature of React, which allows us to derive components based on particular data we want to pass down to them.

Think of it this way:

  • Components return React Elements (JSX)



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Vlad Mihet

Vlad Mihet

Passionate Software Engineer from Romania interested in expanding my knowledge in Web Development by learning new tech architectures and best practices. 😁