Skip to content

Commit 4cc7e0e

Browse files
authored
Update documentation/docs/03-template-syntax/05-await.md
1 parent 2ca0dd8 commit 4cc7e0e

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

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

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,11 @@ 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.
7271

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.
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+
> ```

0 commit comments

Comments
 (0)