diff --git a/packages/solid/src/reactive/signal.ts b/packages/solid/src/reactive/signal.ts index 9e514b15b..138c800b4 100644 --- a/packages/solid/src/reactive/signal.ts +++ b/packages/solid/src/reactive/signal.ts @@ -82,6 +82,7 @@ export interface SignalState extends SourceMapValue { } export interface Owner { + root?: Owner; owned: Computation[] | null; cleanups: (() => void)[] | null; owner: Owner | null; @@ -145,6 +146,7 @@ export function createRoot(fn: RootFunction, detachedOwner?: typeof Owner) ? { owned: null, cleanups: null, context: null, owner: null } : UNOWNED : { + root: detachedOwner?.root ?? owner?.root, owned: null, cleanups: null, context: null, @@ -1396,6 +1398,7 @@ function createComputation( sourceSlots: null, cleanups: null, value: init, + root: Owner?.root, owner: Owner, context: null, pure