Svelte · Senior · Question 60 of 75
What is the difference between mount and hydrate?
- ✓Correct answer:
mountcreates new DOM in the target;hydratereuses server-rendered DOM and attaches behaviour to it - 2They are aliases
- 3
hydrateis only for custom elements
Explanation
Effects (including onMount) don't run during the mount/hydrate call itself; call flushSync() to run them immediately, e.g. in tests.