Skip to content

Commit 7cb4c28

Browse files
committed
fix: access last safe value of prop on unmount
1 parent b275b24 commit 7cb4c28

File tree

1 file changed

+2
-19
lines changed
  • packages/svelte/src/internal/client/reactivity

1 file changed

+2
-19
lines changed

packages/svelte/src/internal/client/reactivity/props.js

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,10 @@ import {
1010
import { define_property, get_descriptor, is_function } from '../../shared/utils.js';
1111
import { mutable_source, set, source, update } from './sources.js';
1212
import { derived, derived_safe_equal } from './deriveds.js';
13-
import {
14-
active_effect,
15-
get,
16-
captured_signals,
17-
set_active_effect,
18-
untrack,
19-
active_reaction,
20-
set_active_reaction
21-
} from '../runtime.js';
13+
import { get, captured_signals, untrack } from '../runtime.js';
2214
import { safe_equals } from './equality.js';
2315
import * as e from '../errors.js';
24-
import {
25-
BRANCH_EFFECT,
26-
CTX_DESTROYED,
27-
DESTROYED,
28-
LEGACY_DERIVED_PROP,
29-
LEGACY_PROPS,
30-
ROOT_EFFECT,
31-
STATE_SYMBOL
32-
} from '../constants.js';
16+
import { CTX_DESTROYED, LEGACY_DERIVED_PROP, LEGACY_PROPS, STATE_SYMBOL } from '../constants.js';
3317
import { proxy } from '../proxy.js';
3418
import { capture_store_binding } from './store.js';
3519
import { legacy_mode_flag } from '../../flags/index.js';
@@ -431,7 +415,6 @@ export function prop(props, key, flags, fallback) {
431415
}
432416
untrack(() => get(current_value)); // force a synchronisation immediately
433417
}
434-
435418
return value;
436419
}
437420

0 commit comments

Comments
 (0)