docs: improve lazy import example

pull/14076/head
Rich Harris 2 years ago
parent b0d255aefe
commit e5abe73959

@ -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 module}
> <module.default />
> {/await}
> ```

Loading…
Cancel
Save