3 ms·
I wish the current detractors would look back at this. The options with life cycles are either huge life cycles with interspersed features OR super painful com
by Griffinsauce 4y ago
I wish the current detractors would look back at this.
The options with life cycles are either huge life cycles with interspersed features OR super painful composition. I've been in big codebases with both and it was absolute hell.
Hooks aren't perfect or pretty but the fact that they can encapsulate AND compose makes them a million times better.
Those codebases are much easier to deal with now. Again, not perfect, but much better.
- DanielHB 4y agohooks were created to replace the functionality of mixins, not necessarily to replace lifecycles The react team could have easily added a useDidUpdate() and useWillMount(), but they didn't because the new abstractions cover the mixins use-cases also work better than lifecycles as well (but somewhat less intuitive at first glance)