Skip to content

Logic vs intuition on list indexes and rerenders in For loops #399

Discussion options

You must be logged in to vote

Solid typically does referential checks. And with its internals relying on mutation this works fine. When you replace an item or remove it referential checks will remove and place new item if applicable. Solid is even more optimized than that though. If you change properties on an object in an array the array doesn't update. We know that it is conceptually the same so no need to reconcile. Under normal situations like typical mutation of array or nested object this will always work.

But that's the thing reconcile can only do so much with deep cloned data. If it is structurally cloned like redux it will attempt to keep references. Failing that it will look for a key property. Default is id

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@martinpengellyphillips
Comment options

@ryansolid
Comment options

Answer selected by martinpengellyphillips
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