3 ms·
> Is there anyone who would argue that React Hooks are "intuitive", or at least become that way after you've used them for long enough? In my experience, they
by crooked-v 6y ago
> Is there anyone who would argue that React Hooks are "intuitive", or at least become that way after you've used them for long enough?
In my experience, they make life much, much easier than using class components as soon as you have any complicated amount of lifecycle management. A lot of componentDidMount, componentDidUpdate, componentWillUnmount, etc stuff collapses down into single useEffect statements, which you can then turn into your own hook wrapper if you're reusing functionality.
- brundolf 6y agoI guess I saw lifecycle methods as a code smell anyway. I pretty much only used them when I had to bridge the gap to some third-party code that didn't live nicely within my React/state management world, or when I was forced to do some manual DOM fiddling in one or two cases. Nothing related to my core logic or state would ever live there, so I never reached a point of "complicated lifecycle management".