other than that I haven't used Solid.js a lot (I've spent considerably more time with Svelte). Really the most magic here is that x() in bigXtracksbigX() invocations and updates them whenever setX() is executed.
(The big difference to React is that Counter only runs once to set everything up - past that it just plain reactivity.)
Playground
Cobbled together by peeking at
other than that I haven't used Solid.js a lot (I've spent considerably more time with Svelte). Really the most magic here is that
x()
inbigX
tracksbigX()
invocations and updates them wheneversetX()
is executed.(The big difference to React is that
Counter
only runs once to set everything up - past that it just plain reactivity.)Svelte adds reactivity by extending the language with reactive declarations and statements (and lets not forget about stores (Solid's stores)).
I guess it ultimately comes down to personal preference!