News for hackers. Stuff that matters.
Re:A Critique of React Hooks by efdee on Monday April 27, 2020 @11:11AM (#22996575)
The reason they introduced hooks was exactly that component lifecycle and decorators/higher order components were found not to scale well in larger codebases (as experienced by the people using React at Facebook).

The useEffect pretty much provides a direct replacement for componentDidMount/componentWillUnmount.

I'm still on the fence, but so far it seems to me that using hooks makes my intent clearer than using the various lifecycle methods.

Re:A Critique of React Hooks by didericis on Monday April 27, 2020 @10:39PM (#23002757)
Can you provide links to articles where react devs detail the scaling issues?

I've found HOCs easy to combine and reason about if I name them carefully, and am still using them on personal projects. When people complain about HOCs not scaling well, are they primarily complaining about name collisions, or performance issues due to deeply nested components/lots of render calls?

Re:A Critique of React Hooks by acemarke on Monday April 27, 2020 @11:49PM (#23003150)
It's primarily about naming collisions and indirection.

I covered some of the tradeoffs in this post and talk:

https://blog.isquaredsoftware.com/2019/07/blogged-answers-th...

https://blog.isquaredsoftware.com/2019/09/presentation-hooks...