We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6c9380c commit ac05b73Copy full SHA for ac05b73
packages/svelte/src/internal/client/proxy.js
@@ -296,10 +296,6 @@ export function proxy(value, onchange) {
296
if (s === undefined) {
297
if (!has || get_descriptor(target, prop)?.writable) {
298
s = with_parent(() => source(undefined, onchange, stack));
299
- set(
300
- s,
301
- with_parent(() => proxy(value, onchange))
302
- );
303
sources.set(prop, s);
304
}
305
} else {
@@ -310,7 +306,9 @@ export function proxy(value, onchange) {
310
306
if (onchange && typeof s.v === 'object' && s.v !== null && STATE_SYMBOL in s.v) {
311
307
s.v[PROXY_ONCHANGE_SYMBOL](onchange, true);
312
308
309
+ }
313
+ if (s !== undefined) {
314
set(
315
s,
316
with_parent(() => proxy(value, onchange))
0 commit comments