Skip to content

Commit

Permalink
docs: improve lazy import example (#14076)
Browse files Browse the repository at this point in the history
* docs: improve lazy import example

* Update documentation/docs/03-template-syntax/05-await.md
  • Loading branch information
Rich-Harris authored Oct 31, 2024
1 parent b0d255a commit 0ed914b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions documentation/docs/03-template-syntax/05-await.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ Similarly, if you only want to show the error state, you can omit the `then` blo
{/await}
```

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

0 comments on commit 0ed914b

Please sign in to comment.