Svelte · Junior · Question 30 of 76

What is a snippet?

{#snippet row(item)}
  <tr><td>{item.name}</td></tr>
{/snippet}

{@render row(first)}

Explanation

Snippets replace named slots: a component can accept header, row and other snippet props.

Further reading

Problem with a question

Svelte · Junior · question 30

Test yourself

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

Take this quiz