S
SolidJS6mo ago
Jakob

tree structure: granular updates and retain open state

can only replace the whole tree at once so I tried reconcile with a store, but I don't want all <details> to close when it happens https://playground.solidjs.com/anonymous/c4a3c7e0-c9d8-454f-8a70-7766b67cab75
Solid Playground
Quickly discover what the solid compiler will generate from your JSX template
4 Replies
foolswisdom
foolswisdom6mo ago
A potential problem is that For operates using reference equality, but object.entries will produce a new array of (new) key/value pairs (as two element arrays), so you won't keep reference equality Also, probably not related to your problem, but using if/else branching in js (rather than in jsx) means that you won't see updates unless the function callback runs again (which is not how it is meant to work by design)
Jakob
JakobOP6mo ago
oops forgot about that, updated to use <Show>
foolswisdom
foolswisdom6mo ago
Better to use object.keys And then index Not sure if it'd solve your problem, if it doesn't, I'd need to take a better look
Jakob
JakobOP6mo ago
that seems to work, thx
Want results from more Discord servers?
Add your server