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
This commit is contained in:
Kristiyan Kostadinov
2022-11-06 12:56:49 +01:00
committed by Andrew Kushnir
parent db867fee77
commit c3bc035f5d
+1 -3
View File
@@ -166,9 +166,7 @@ export class ComponentFactory<T> extends AbstractComponentFactory<T> {
const elementName = this.componentDef.selectors[0][0] as string || 'div';
const hostRNode = rootSelectorOrNode ?
locateHostElement(hostRenderer, rootSelectorOrNode, this.componentDef.encapsulation) :
createElementNode(
rendererFactory.createRenderer(null, this.componentDef), elementName,
getNamespace(elementName));
createElementNode(hostRenderer, elementName, getNamespace(elementName));
const rootFlags = this.componentDef.onPush ? LViewFlags.Dirty | LViewFlags.IsRoot :
LViewFlags.CheckAlways | LViewFlags.IsRoot;