Untrack on store arrays
Yesterday I had some misunderstandings around
createEffect
and stores. Today I probably have similar misunderstandings around untrack
.
My assumption was that, e.g.
would not re-trigger the effect. That, however, seems not to be the case. I'm sure there's a good reason for it. It feels quite unintuitive to me though.
https://playground.solidjs.com/anonymous/fbb65302-6799-436c-9abd-287968aaa708Solid Playground
Quickly discover what the solid compiler will generate from your JSX template
3 Replies
The problem is that each property of a store is a signal, so really all you're doing with that untrack is stopping changes to the "arr" signal from triggering the effect but not the properties within "arr" that could also be signals or even the
length
So there’s no way to untrack arrays in stores? I tried untracking the length and each individual index before reading but that did not help.
it sounds like you really want
unwrap
instead? To suppress the deep reactivity