Higher-Order Components
An HOC is a function that takes a component and returns a new component, usually injecting props: withUser(Hello) → Hello receives user. withRouter was famous. Pattern: function withX(Wrapped) { return function Wrapper(props) { return <Wrapped {...props} extra={…} />; }; }
Hooks replaced most HOCs. withUser becomes useUser(). HOCs still appear in old code and some libraries. Mention wrapper hell (many HOCs) as the reason teams switched.
Higher-Order Components — on screen — Asha. withUser injected user. Today a custom hook useUser() is simpler.
Parent
│ props (read-only)
▼
Child → UIDefine HOC + say hooks replaced most.