I'm sorry to say that, but you clearly didn't really understand hooks up to now. You view them through a pair of class style react glasses - which is most prominent when you start to call function components "funclasses". I've seen this with often with mid range react developers. It is a normal stage about unlearning old habits before understanding new concepts. Actually - newbies seem to get on speed with hooks much quicker than older react developers which are used to class based components and the life cycle methods.

Hooks are a feature inspired by algebraic effects - which JS doesn't support by itself. Hooks allow you to decouple concepts like state or side effects and make them reusable in modular and encapsulated fashion. Its really ingenious how simple it got to implement a feature consisting of state, side effects and maybe context with just some function and making it reusable in any component you want. It is much easier to understand complex behaviour implemented in a hook compared to an implementation distributed over lifecycle methods, state and perhaps even some third party state management.

This wasn't easily - if even - possible with class based components. The lifecycle methods did mix up code from different features and you need to jump through hoops to make such code reusable in any clean way.

Developer — Author — Photographer — Guitarist

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