Skip to content

Commit f075248

Browse files
committed
tweaks
1 parent bf0a934 commit f075248

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/svelte/src/index-client.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { is_array } from './internal/shared/utils.js';
66
import { user_effect } from './internal/client/index.js';
77
import * as e from './internal/client/errors.js';
88
import { lifecycle_outside_component } from './internal/shared/errors.js';
9+
import { legacy_mode_flag } from './internal/flags/index.js';
910

1011
/**
1112
* The `onMount` function schedules a callback to run as soon as the component has been mounted to the DOM.
@@ -25,7 +26,7 @@ export function onMount(fn) {
2526
lifecycle_outside_component('onMount');
2627
}
2728

28-
if (component_context.l !== null) {
29+
if (legacy_mode_flag && component_context.l !== null) {
2930
init_update_callbacks(component_context).m.push(fn);
3031
} else {
3132
user_effect(() => {

0 commit comments

Comments
 (0)