Svelte · Junior · Question 13 of 76
How does a component receive props in Svelte 5?
<script>
let { name, count = 0 } = $props();
</script>- ✓Correct answer: With the
$props()rune and destructuring, including default values - 2With
export let name - 3Via
this.props
Explanation
export let is the Svelte 4 syntax. With $props() you can also collect the rest: let { a, ...rest } = $props().