diff --git a/packages/core/src/render3/instructions/shared.ts b/packages/core/src/render3/instructions/shared.ts index dc8587c41d..5344b0a34c 100644 --- a/packages/core/src/render3/instructions/shared.ts +++ b/packages/core/src/render3/instructions/shared.ts @@ -1321,19 +1321,17 @@ function baseResolveDirective(tView: TView, viewData: LView, def: DirectiveDe } function addComponentLogic(lView: LView, hostTNode: TNode, def: ComponentDef): void { - const native = getNativeByTNode(hostTNode, lView); + const native = getNativeByTNode(hostTNode, lView) as RElement; const tView = getOrCreateTView(def); // Only component views should be added to the view tree directly. Embedded views are // accessed through their containers because they may be removed / re-added later. const rendererFactory = lView[RENDERER_FACTORY]; const componentView = addToViewTree( - lView, createLView( - lView, tView, null, def.onPush ? LViewFlags.Dirty : LViewFlags.CheckAlways, - lView[hostTNode.index], hostTNode as TElementNode, rendererFactory, - rendererFactory.createRenderer(native as RElement, def))); - - componentView[T_HOST] = hostTNode as TElementNode; + lView, + createLView( + lView, tView, null, def.onPush ? LViewFlags.Dirty : LViewFlags.CheckAlways, native, + hostTNode as TElementNode, rendererFactory, rendererFactory.createRenderer(native, def))); // Component view will always be created before any injected LContainers, // so this is a regular element, wrap it with the component view