Can custom hooks replace HOC in react?

Forums ReactCan custom hooks replace HOC in react?
Staff asked 2 years ago

Answers (1)

Add Answer
Jaydip Mali Marked As Accepted
Staff answered 2 years ago

Hooks were designed to replace class and provide another great alternative to compose behavior into your components. Higher Order Components are also useful for composing behavior. There is some obvious overlap, so do React hooks replace Higher Order Components? It’s pretty clear that they can replace some HOCs.

see this link: https://medium.com/javascript-scene/do-react-hooks-replace-higher-order-components-hocs-7ae4a08b7b58

Subscribe

Select Categories