Skip to content

Commit 2ca0dd8

Browse files
authored
Update 05-await.md
Closes #13990 Adds a example of dynamic component usage with the help of {#await...} syntax
1 parent e99e865 commit 2ca0dd8

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+
Also you can render dynamic components with the help of import() function.
72+
73+
```svelte
74+
{#await import('./Component.svelte') then Component}
75+
<Component.default/>
76+
{/await}
77+
```
78+
79+
> [!NOTE] You need to add `.default` since components export a default only.

0 commit comments

Comments
 (0)