Svelte · Middle · Question 20 of 75
Why are transitions in Svelte local by default?
{#if showList}
{#each items as item}
<li transition:slide>{item}</li>
{/each}
{/if}- ✓Correct answer: They play only when their own block is added or removed, not when a parent block appears; add
|globalto change this - 2They play only once per page load
- 3They play only on mobile
Explanation
So toggling showList won't animate each item, but adding an item to items will.