4 ms·
I agree with this as well. When hooks were released I thought it was a ridiculous generalization and abstraction over something that already worked. However, af
by warent 7y ago
I agree with this as well. When hooks were released I thought it was a ridiculous generalization and abstraction over something that already worked. However, after using it in production for a while I can say I've seen the light and will not go back to component classes. After using hooks, you realize how bloated classes are, and how much logic gets crammed into componentDidUpdate in a weird bundle of mixed up concerns, all of which are now nicely clarified and flattened out with useEffect.
Another fascinating thing about useEffect is that it works in such a way that you easily realize common dependencies to reduce your code and improve performance overall.
Combine all this with TypeScript and building simple yet robust frontends is better than ever these days.