Skip to content

Commit 0ed914b

Browse files
authored
docs: improve lazy import example (#14076)
* docs: improve lazy import example * Update documentation/docs/03-template-syntax/05-await.md
1 parent b0d255a commit 0ed914b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ Similarly, if you only want to show the error state, you can omit the `then` blo
6969
{/await}
7070
```
7171

72-
> [!NOTE] You can use `#await` to render dynamic components with the help of the `import()` function:
72+
> [!NOTE] You can use `#await` with [`import(...)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import) to render components lazily:
7373
>
7474
> ```svelte
75-
> {#await import('./Component.svelte') then Component}
76-
> <Component.default />
75+
> {#await import('./Component.svelte') then { default: Component }}
76+
> <Component />
7777
> {/await}
7878
> ```
7979

0 commit comments

Comments
 (0)