pull/12602/head
Rich Harris 2 years ago
parent 0b7d67cf3d
commit 32ad528c01

@ -44,6 +44,8 @@ const app = mount(App, {
});
```
Note that unlike calling `new App(...)` in Svelte 4, things like effects (including `onMount` callbacks, and action functions) will not run during `mount`. If you need to force pending effects to run (in the context of a test, for example) you can do so with `flushSync()`.
### `hydrate`
Like `mount`, but will reuse up any HTML rendered by Svelte's SSR output (from the [`render`](#svelte-server-render) function) inside the target and make it interactive:
@ -59,6 +61,8 @@ const app = hydrate(App, {
});
```
As with `mount`, effects will not run during `hydrate` — use `flushSync()` immediately afterwards if you need them to.
### `unmount`
Unmounts a component created with [`mount`](#svelte-mount) or [`hydrate`](#svelte-hydrate):

Loading…
Cancel
Save