3 ms·
> Hooks are nice for small components, but overall haven’t improved DX over classes much, and introduced a ton of new concerns. Composition itself is a huge DX
by kushan2020 5y ago
> Hooks are nice for small components, but overall haven’t improved DX over classes much, and introduced a ton of new concerns.
Composition itself is a huge DX improvement.
> It also makes it harder to reason about component lifecycle.
I would argue that it is the same if not better than class based components. One of the amazing things about hooks is that you can ignore all of the hook updates and just treat the values returned by them static to see how the rendering will happen at a particular instance.
- bryanrasmussen 5y agoFor simple states hooks are the same if not better, I would say almost probably better. For complicated states where you need 4+ hooks - well in that case most of the time refactoring is needed but there are cases where it should not be refactored and I have a certainty something could be done much easier with the old class based way of doing it, but then I would have to deal with people in PR who say we must use hooks for everything.