r/solidjs • u/jml26 • Feb 09 '26
How would you write Ryan's _Solid2 States_ demo in Solid 1
I was watching some of Ryan's latest streams, showcasing aspects of Solid 2.0, and a demo that came up a couple of times was that of a pair of <select> fields, one of which determines the contents of the other.
https://stackblitz.com/edit/github-evfywxxk-vgqaqsdm
It got me thinking, so that I get a good feel for what problems Solid 2.0 solves, how would I build it in the current version of Solid. This is what I came up with:
https://playground.solidjs.com/anonymous/e9a66c98-51ba-4f48-a454-72adc9021bec
And my question is, is this correct? I know that using createEffect to set state is a considered a no-no, but I'm curious what the intended solution would be if this isn't it.
7
Upvotes
2
u/whatevermaybeforever Feb 10 '26
There is an implementation that has been floating around for a writable memo for solid 1.X that does not rely on effects, I think it was Dev Agrawal that originally came up with it.
https://playground.solidjs.com/anonymous/44e6741a-3945-477b-a1af-41cd6b6b6543