Skip to content

Commit 6a1b5dd

Browse files
Devr-prodummdidumm
andauthored
docs : add an example of using dynamic components (#13993)
Closes #13990 --------- Co-authored-by: Simon H <[email protected]>
1 parent 6b6445a commit 6a1b5dd

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

documentation/docs/03-template-syntax/05-await.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,12 @@ Similarly, if you only want to show the error state, you can omit the `then` blo
6868
<p>The error is {error}</p>
6969
{/await}
7070
```
71+
72+
> [!NOTE] You can use `#await` to render dynamic components with the help of the `import()` function:
73+
>
74+
> ```svelte
75+
> {#await import('./Component.svelte') then Component}
76+
> <Component.default />
77+
> {/await}
78+
> ```
79+

0 commit comments

Comments
 (0)