Skip to content

docs: improve lazy import example #14076

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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}
> ```