Remix.run Logo
torginus 3 hours ago

My 2 cents: I am not an experienced React dev, but the React compiler came out recently with React 19, which is supposed to do the same thing as Svelte's - eliminate unnecessary DOM modifications by explicitly tracking which components rely on what state - thus making useMemo() unnecessary.

Since the article still references useMemo(), I wonder how up-to-date the rest of the article is.

littlecranky67 3 hours ago | parent | next [-]

React has always been tracking what component relies on what state, independent of the compiler. That is one of the reason the rule-of-hook has to exist - it tracks if a component calls useState() and thus knows the according setState function that manipulates that particular state.

Idk why people claim React is bloat, especially since you can switch to Preact (4kb) most of the time without changes if filesize is an issue for you.

epolanski 8 minutes ago | parent | next [-]

> Idk why people claim React is bloat

Because it's very hard to control it's rendering model. And the fact that multi billion dollar startups and multi trillion dollar companies hiring ivy league charlatans still have bloated low-performing websites written in react (that don't even need react...) clearly states the issues aren't that trivial.

> React has always been tracking what component relies on what state, independent of the compiler.

This still needs a complete parsing and analysis of your components and expressions. Which is why there is no single very performing UI library that can avoid directives.

Capricorn2481 an hour ago | parent | prev [-]

Because people make shitty React apps and people think React is slow because of it.

It's definitely not slow here. It's within 20% of Svelte. That's not nothing, but it's not the huge monster people claim it is

https://krausest.github.io/js-framework-benchmark/2025/table...

epolanski 4 minutes ago | parent [-]

When 99% of React apps (websites tbh, with very few needs for complex reactivity...) including those built by multi billion/trillion $ companies, struggle to produce non-bloated, non-slow, accessible websites, you know that the library is simply too complex to tame.

Of course React can be performant, but still, you're getting a PhD in its internals and hooks to get what you have in vue/nuxt/svelte whatever out of the box.

bryanrasmussen 3 hours ago | parent | prev [-]

useMemo is for maintaining calculations of dependencies between renders, renders generally caused by state changes. React always tries to track state changes, but complicated states (represented by deep objects) can be recalculated too often - not sure if React 19 improves this, don't think so when reading documentation.

on edit: often useMemo is used by devs to cover up mistakes in rendering architecture. I believe React 19 improves stuff so you would not use useMemo, but not sure if it actually makes useMemo not at all useful.