/web
Web development, frameworks, and tools
submit
ad
Advertise in /web
Reach our web-focused community
/post#cm5lx2v3
reply to post

We're not missing better reactive primitives, we're missing native immutability

Some of the newer frameworks have attempted a better reactivity story than what react offers (Svelte is an obvious example), however there's footguns everywhere (array.push(), etc). Increasingly people are turning to Proxies to get around these limitations but it's just more magic and indirection.

If we look at why state management gets annoying in react, it's the pass by reference semantics. UseMemo and UseCallback infect every corner of a codebase. Why? You have no way to know if the hooks you are using do the deep-equality bullshit for you, or if you're expected it do it yourself.

Would our lives be dramatically easier if {foo: "bar"} === {foo: "bar"}?

1d|
Anonymous
|reply||
2 comments
Deep equality huh...?
21h|
Anonymous
||
Once React adding the syntactic fluffy `class` syntax, most of knew that it was over. What was once a simple view-library, will now grow to manage everything eventually, while we haven't gotten that far yet. There was a golden period where people were all about immutability, and things were nice for a while. But then `hooks` appeared, people stopped promoting pure functions and here we are yet again, a tangled mess of state that people mutate from every angle and corner of the program...
17h|
vblr!c5f8cfd469
||
Add a comment
0/2000