Skip to content

Why doesn't the store update trigger a re-render of all dependent elements? #674

Answered by ryansolid
isaacHagoel asked this question in Q&A
Discussion options

You must be logged in to vote

You are destructuring your store in the rest parameters of your component. This loses reactivity. In general don't destructure props with Solid. In your case only line 11 in Board.tsx is an issue. But if your columns were more dynamic they'd have a problem too.

Also Solid Stores allow for more performant path based setters (similar to ImmutableJS).. cloning in setStore top-level causes everything to have to re-evaluate throughout the whole object. Where using the path gives us the ability to perform the most localized change without diffing. Here is how I used setStore:

setStore(
  "columnItems",
  (column) => column.id === columnId,
  "items",
  (prevItems) => shuffleArray(prevItems)
);
 
 

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@isaacHagoel
Comment options

Answer selected by isaacHagoel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants