DEV Community

Discussion on: Class Components vs Functional Components in React

Collapse
 
mehmehmehlol profile image
Megan Lo

I am still learning about custom hooks atm! Would you mind elaborating more on that and how it is easier than writing HOC for readers who just started exposing to functional components? thanks!

Collapse
 
alekseiberezkin profile image
Aleksei Berezkin

I'm not sure I can explain this in couple of words 🙂 In general, HOCs require you to combine and destructure passed props which is always cumbersome. Implementing some logic atop of it adds more complexity. Perhaps you find interesting my post on creating no-lib global store. I implement it with hooks, and that's trivial; then reimplement the same with HOCs, and that looks very convoluted.