Svelte · Senior · Question 13 of 75
What does experimental async Svelte (5.36+) allow?
<script>
let { id } = $props();
const user = $derived(await getUser(id));
</script>
<h1>{user.name}</h1>- ✓Correct answer: Using
awaitat the top level of<script>, inside$derivedand in markup; it requiresexperimental.async - 2Running components in web workers
- 3Async event handlers only
Explanation
It's opt-in because it's not yet considered stable. Combined with <svelte:boundary> it handles pending states.