This is so much more complicated than the class approach.
What's saved in lines of code is lost in expressiveness.
Feels like a step toward Ruby-like magic.
What's saved in lines of code is lost in expressiveness.
Feels like a step toward Ruby-like magic.
While I understand the argument that hooks encourage to make dumb components stateful this is already the case with class based components. At the end of the day a developer is responsible for separating concerns of his application and he can fail to do so with class based components and hooks the same way.