Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Hooks -React Fiber actually- really messed with my spatial awareness of components.

When I started using React I got used to knowing at which point in the lifecycle some things would run, and hooks threw a wrench in that.

Took me several months to actually get used to the way things work now, but lately I've found myself not even thinking about those things any more, which would mean the entire matter of lifecycle was removed from my problem space in such a tidy and neat way I find that amazing.

I'd love to see some more transpiling magic around them though, most of the bundled hooks have clear correlations to plain JS and it would be pretty cool if the same dev stacks we use could let me write plainer JS and handle that wrinkle for me too.



That‘s how I think of hooks. They don‘t let you express the lifecycle of things, only the data dependency graph. React moved the level of abstraction a second time, and I think they succeeded.


You still need to understand lifecycle of a component to understand how useEffect() works though...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: