Skip to content

Commit 9b55af0

Browse files
committed
duplicate
1 parent 32ad528 commit 9b55af0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

documentation/docs/04-runtime/04-imperative-component-api.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ const app = mount(App, {
2929

3030
You can mount multiple components per page, and you can also mount from within your application, for example when creating a tooltip component and attaching it to the hovered element.
3131

32+
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()`.
33+
3234
## `unmount`
3335

3436
Unmounts a component created with [`mount`](#mount) or [`hydrate`](#hydrate):
@@ -74,3 +76,5 @@ const app = hydrate(App, {
7476
props: { some: 'property' }
7577
});
7678
```
79+
80+
As with `mount`, effects will not run during `hydrate` — use `flushSync()` immediately afterwards if you need them to.

0 commit comments

Comments
 (0)