← Back to context

Comment by Capricorn2481

13 hours ago

I'm all for people avoiding React if they want, but I do want to respond to some of this, as someone who has made a few React apps for work.

> When they started adding new hooks just to work around their own broken component/rendering lifecycle, I knew React was doomed to become a bloated mess.

Hooks didn't fundamentally change anything. They are ways to escape the render loop, which class components already had.

> Nobody in their right mind is remembering to use `useDeferredValue` or `useEffectEvent` for their very niche uses.

Maybe because you don't necessarily need to. But for what it's worth, I'm on old versions of React when these weren't things, and I've built entire SPAs out without them at work. But reading their docs, they seem fine?

> And don't get me started on React's sad excuse for global state management with Contexts. A performance nightmare full of entire tree rerenders on every state change

I think it's good to give context on what a rerender is. It's not the same as repainting the DOM, or even in the same order of magnitude of CPU cycles. Your entire site could rerender from a text input, but you're unlikely to notice it even with 10x CPU slowdown in Devtools, unless you put something expensive in the render cycle for no reason. Indeed, I've seen people do a fetch request every time a text input changes. Meanwhile, if I do the same slowdown on Apple Music which is made in Svelte, it practically crashes.

But pretty much any other state management library will work the way you've described you want.