diff --git a/src/core/component.ts b/src/core/component.ts index 55e16f59..1a779be3 100644 --- a/src/core/component.ts +++ b/src/core/component.ts @@ -18,7 +18,7 @@ export abstract class Component { * A symbol that identifies this component, and it also used to selectively * grant access to its privileged functions. */ - protected _key = Symbol(uuidv4()); + protected readonly _key = Symbol(uuidv4()); /** * The container of this component. Each component is contained by a diff --git a/src/core/reactor.ts b/src/core/reactor.ts index 2b9e0e45..c36e624b 100644 --- a/src/core/reactor.ts +++ b/src/core/reactor.ts @@ -393,10 +393,7 @@ export abstract class Reactor extends Component { } } else if (allowCreatorKey ?? false) { console.log("trying to get key......") - if (this._creatorKeyChain.get(component) != null) { - return this._creatorKeyChain.get(component); - } - return this._creatorKeyChain.get(component.getContainer()); + return component.getContainer()._getKey(component, this._creatorKeyChain.get(component.getContainer())); } }