News for hackers. Stuff that matters.
Re:React I love you, but you're bringing me down by ericmcer on Tuesday September 20, 2022 @01:13PM (#32914765)
Hooks are a natural progression from class components, class components seem more straightforward with all the willMount beforeMount etc. but they trick you into visualizing your component in different states of mounted/rendered/etc. That goes against what React wants to be at its core, which is totally immutable and pure, it isn't mounted or pre/post-render it looks the same whether it is the first render or the 100th. Ultimately I think the mental model of the component as a pure function is superior to juggling the react lifecycle.

There are no comments on this comment yet.