Svelte · Middle · Question 15 of 75

What is an advantage of snippets over Svelte 4 slots?

Explanation

Top-level snippets can even be referenced inside <script>, and exported from <script module> if they don't use component state.

Further reading

Problem with a question

Svelte · Middle · question 15

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