Post

tried writing this blog 3 times but it’s really boring, so here’s the short version: React won. Every mainstream f/w now implements its ideas, and developed their own ecosystems. The ones that didn’t, lost and died. This implies there’s no _strong_ reason to not pick one of the other winners.

I still genuinely don't know what "React adopt signals" would _mean_ at a technical level. Per other comments in this thread, React works at the component level. What would a hypothetical native-to-React signals integration do differently?

It would have to have been something new. Breaking likely. Signals would allow: - finer grained updates than “component” e.g. jsx fragments - state/data flow that isn’t tied to component hierarchy and doesn’t need to rerender (or subscribe to a store to rerender) itself and its children

for change detection. - useMemo/useCallback would actually only get used for heavy computations instead of referential stability Just spitballing here. But look at Preact signals for more ideas.

The cynical reason why this never happened in React would be because it devalues React. If you don't need components to build complex trees of state, you barely need components at all. And then you barely need react at all. Working on React or a React FW subconsciously biases away from that.

You still need components for the domain modeling benefits. So signals let you re-render at the element level? That’s pretty neat. Guess you could do that by composing even smaller components but that probably gets unwieldy 🤔

Behind the scenes if you use a signal in an element position in JSX it gets interpreted as a tiny self-updating component in React and Preact. Attributes and text bind directly to DOM.

it's pretty clever, in many ways simpler than native React state management I still feel like perf gets weird when mixing signals, hooks, contexts 🥴 no weirder than most state managers for React ofc, they all feel kinda weird to really "win" with this, I'd want to go all-in and use signals only 😌

0 reposts1 like

No replies yet.