docs : add an example of using dynamic components (#13993)

Closes #13990

---------

Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
pull/14064/head
Devr 5 days ago committed by GitHub
parent 6b6445a934
commit 6a1b5dd004
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -68,3 +68,12 @@ Similarly, if you only want to show the error state, you can omit the `then` blo
<p>The error is {error}</p>
{/await}
```
> [!NOTE] You can use `#await` to render dynamic components with the help of the `import()` function:
>
> ```svelte
> {#await import('./Component.svelte') then Component}
> <Component.default />
> {/await}
> ```

Loading…
Cancel
Save