Re:React I love you, but you're bringing me down
by nightski on Tuesday September 20, 2022 @01:37PM
(#32915088)
It would be funny if it were true. Hooks were made for composable behavior for components.
[ Parent
| on HN ]
Re:React I love you, but you're bringing me down
by engineeringwoke on Tuesday September 20, 2022 @02:12PM
(#32915652)
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.
Re:React I love you, but you're bringing me down
by nightski on Tuesday September 20, 2022 @04:13PM
(#32917163)
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.
Re:React I love you, but you're bringing me down
by skydhash on Tuesday September 20, 2022 @06:37PM
(#32918713)
I agree with you. It's much better to have useAuth everywhere than having WithAuth capping every class.