Skip to content

Commit c3bc035

Browse files
crisbetoAndrewKushnir
authored andcommitted
refactor(core): remove duplicate createRenderer call (#47981)
Fixes that we were calling `createRenderer` even though we had one already. This likely wasn't a performance issue since the renderer factory caches the renderer, but it's still better to reuse it to avoid confusion in the future. Fixes #47980. PR Close #47981
1 parent db867fe commit c3bc035

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

‎packages/core/src/render3/component_ref.ts‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,7 @@ export class ComponentFactory<T> extends AbstractComponentFactory<T> {
166166
const elementName = this.componentDef.selectors[0][0] as string || 'div';
167167
const hostRNode = rootSelectorOrNode ?
168168
locateHostElement(hostRenderer, rootSelectorOrNode, this.componentDef.encapsulation) :
169-
createElementNode(
170-
rendererFactory.createRenderer(null, this.componentDef), elementName,
171-
getNamespace(elementName));
169+
createElementNode(hostRenderer, elementName, getNamespace(elementName));
172170

173171
const rootFlags = this.componentDef.onPush ? LViewFlags.Dirty | LViewFlags.IsRoot :
174172
LViewFlags.CheckAlways | LViewFlags.IsRoot;

0 commit comments

Comments
 (0)