Skip to content

Commit 917816f

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 ea3374c commit 917816f

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

packages/core/src/render3/component_ref.ts

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

176174
const rootFlags = this.componentDef.onPush ? LViewFlags.Dirty | LViewFlags.IsRoot :
177175
LViewFlags.CheckAlways | LViewFlags.IsRoot;

0 commit comments

Comments
 (0)