Nested object signal
Hey! I have trouble getting changes in a nested object to trigger a rerender. My object looks like this:
When changing
show
from true to false, the dom doesn't rerender :/
I created a simplified example in the playground:
https://playground.solidjs.com/anonymous/3f20d81d-25cf-45a7-9931-316bf3be7495
After changing the signal, it doesn't update the dom to reflect the change. What am I missing?2 Replies
Changing a property of an object doesn't change the object itself.
So the properties themselves need to be nested signals. Or, much more easily, you can use a store.
oh I see. Another solution I just discovered is to replace the whole object with a new one instead of editing a property:
Doesn't feel 100% like the cleanest solution tho. I have to get familiar with stores :)