update onMount docs

pull/15107/head
Ben McCann 2 years ago
parent 46b2479fe2
commit e6fc4e23ce

@ -17,6 +17,9 @@ import { legacy_mode_flag } from './internal/flags/index.js';
*
* `onMount` does not run inside [server-side components](https://svelte.dev/docs/svelte/svelte-server#render).
*
* `onMount` runs only once. If you need reactivity, you can use [`$effect`](https://svelte.dev/docs/svelte/$effect),
* which also runs when the component is mounted to the DOM.
*
* @template T
* @param {() => NotFunction<T> | Promise<NotFunction<T>> | (() => any)} fn
* @returns {void}

@ -356,6 +356,9 @@ declare module 'svelte' {
*
* `onMount` does not run inside [server-side components](https://svelte.dev/docs/svelte/svelte-server#render).
*
* `onMount` runs only once. If you need reactivity, you can use [`$effect`](https://svelte.dev/docs/svelte/$effect),
* which also runs when the component is mounted to the DOM.
*
* */
export function onMount<T>(fn: () => NotFunction<T> | Promise<NotFunction<T>> | (() => any)): void;
/**

Loading…
Cancel
Save