File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed
Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,9 @@ import { legacy_mode_flag } from './internal/flags/index.js';
1717 *
1818 * `onMount` does not run inside [server-side components](https://svelte.dev/docs/svelte/svelte-server#render).
1919 *
20+ * `onMount` runs only once. If you need reactivity, you can use [`$effect`](https://svelte.dev/docs/svelte/$effect),
21+ * which also runs when the component is mounted to the DOM.
22+ *
2023 * @template T
2124 * @param {() => NotFunction<T> | Promise<NotFunction<T>> | (() => any) } fn
2225 * @returns {void }
Original file line number Diff line number Diff line change @@ -356,6 +356,9 @@ declare module 'svelte' {
356356 *
357357 * `onMount` does not run inside [server-side components](https://svelte.dev/docs/svelte/svelte-server#render).
358358 *
359+ * `onMount` runs only once. If you need reactivity, you can use [`$effect`](https://svelte.dev/docs/svelte/$effect),
360+ * which also runs when the component is mounted to the DOM.
361+ *
359362 * */
360363 export function onMount < T > ( fn : ( ) => NotFunction < T > | Promise < NotFunction < T > > | ( ( ) => any ) ) : void ;
361364 /**
You can’t perform that action at this time.
0 commit comments