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}

Explanation

So toggling showList won't animate each item, but adding an item to items will.

Further reading

Problem with a question

Svelte · Middle · question 20

Test yourself

Take the Svelte · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz