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
When filtering a list using a store value, it doesn't trigger a re-render if the filtering is done inline in an expression. It does trigger a re-render if you create a reactive variable first.
This does not trigger a re-render of the code inside the each block if $selectedItem is updated: {#each $list.filter(d => d === $selectedItem) as item}
But first declaring this... $: filteredList = $list.filter(d => d === $selectedItem) as item}
... and then ... {#each filteredList as item}
... does re-render the each block when the $selectedItem is updated.
I would expect in the latter case that a re-render would be triggered as well, since $selectedItem is updated
When filtering a list using a store value, it doesn't trigger a re-render if the filtering is done inline in an expression. It does trigger a re-render if you create a reactive variable first.
This does not trigger a re-render of the code inside the
each
block if$selectedItem
is updated:{#each $list.filter(d => d === $selectedItem) as item}
But first declaring this...
$: filteredList = $list.filter(d => d === $selectedItem) as item}
... and then ...
{#each filteredList as item}
... does re-render the
each
block when the$selectedItem
is updated.I would expect in the latter case that a re-render would be triggered as well, since
$selectedItem
is updatedSee the example in the REPL for the mentioned behavior: https://svelte.dev/repl/57a0f818a94642ea8413a6372b6ecc38?version=3.2.0
Using Svelte v3.2.0
The text was updated successfully, but these errors were encountered: