higher-order component

A function that takes a component and returns a new component wrapping it with extra props or behaviour.

In more detail

HOCs, written like withUser(Profile), were a common way to share logic before hooks. They add wrapper layers to the tree, can overwrite props with the same name and hide where a prop comes from, so custom hooks usually replace them today.

Related terms

Taught in

References