finsook
finsook
SSolidJS
Created by finsook on 6/20/2024 in #support
Reactivity not referentially transparent?
I don't understand why CounterList doesn't work here: https://playground.solidjs.com/anonymous/656ba247-562b-4c2b-b32a-bf734e09fd90. Clicking the others works fine but the middle row of buttons doesn't update. At least there is an ESLint warning, but it seems like adding a let shouldn't change anything. It seems to be something with how the compile-time reactivity works. The message mentions "tracked scopes" but I have no idea how they work and there is very little mention in the documentation. Isn't Index a tracked scope?
<Index each={countList()}>
{(count) => {
let c = count();
return <button type="button" onClick={increment}>
{ c.x + " " + c.y }
</button>
}}
</Index>
<Index each={countList()}>
{(count) => {
let c = count();
return <button type="button" onClick={increment}>
{ c.x + " " + c.y }
</button>
}}
</Index>
63 replies