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

Funny that this whole hooks mess could have probably been better resolved with investment in developing optimization patches for v8 rather than attempting to "fix" React


It would be funny if it were true. Hooks were made for composable behavior for components.


How would Facebook convince the community to dogfood their new API without some marketing buzz? It's pretty obvious that V8 has trouble optimizing changes to object properties because of the design of the spec, and they were also pretty open about it in the blogs where hooks were introduced. I think it's also clear that useEffect is harder to grok than it's lifecycle equivalents, so there might be other things at play than composability.

It's also a bit funny that certain kinds of people can just brush off these things with some non-sequitur on a message board when there are almost always bigger things at play.


I was just going off my own experience with React through the years. It was very hard to compose behavior with class based components. We had to create higher order components that had functions as children which could pass down data as arguments to the child function. It really made a mess of the component hierarchy. Now you can create reusable custom hooks that can be used from any component.


I agree with you. It's much better to have useAuth everywhere than having WithAuth capping every class.


My understanding as well though a lot of the details may be perf related..

Ultimately hooks are probably the way they are for the same reason Redux is the way it was(pre RTK I suppose)..




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

Search: