SolidJSS
SolidJS8mo ago
lemonad

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.
createEffect(() => {
  const prevArr = untrack(() => prevConfig.arr);
  setPrevConfig("arr", 0, { x: 1 });
});

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-287968aaa708
Quickly discover what the solid compiler will generate from your JSX template
Was this page helpful?