You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With Angular you can use track by with ng-repeat and with React the key parameter to reorder/reuse DOM elements. Does Svelte have reordering/reusing option with each?
The text was updated successfully, but these errors were encountered:
Not currently. It's definitely on the TODO list. There are basically two (possibly overlapping) approaches that are possible:
Use some syntax to declare the key, like {{#each:id ...}} or {{#eachkeyed foo, i, key}} or whatever.
Create an API for manipulating lists programmatically
The advantage of 1 is that it's an easy way to get that functionality even in deeply nested each blocks. The advantage of 2 is that you can be very precise about which parts of the component need to be checked for changes (i.e. you can insert an item into a list and not touch anything else at all, whereas with keyed updates you need to account for changes in items whose keys are the same), and there's no requirement for any sort of diffing.
With Angular you can use
track by
withng-repeat
and with React thekey
parameter to reorder/reuse DOM elements. Does Svelte have reordering/reusing option witheach
?The text was updated successfully, but these errors were encountered: