refactor(ivy): remove code duplication around root component view creation (#31946)
PR Close #31946
This commit is contained in:
parent
a7c71d1a57
commit
32e2f4daef
|
@ -144,8 +144,6 @@ export function renderComponent<T>(
|
|||
component = createRootComponent(
|
||||
componentView, componentDef, rootView, rootContext, opts.hostFeatures || null);
|
||||
|
||||
addToViewTree(rootView, componentView);
|
||||
|
||||
refreshDescendantViews(rootView); // creation mode pass
|
||||
rootView[FLAGS] &= ~LViewFlags.CreationMode;
|
||||
resetPreOrderHookFlags(rootView);
|
||||
|
@ -188,6 +186,8 @@ export function createRootComponentView(
|
|||
initNodeFlags(tNode, rootView.length, 1);
|
||||
}
|
||||
|
||||
addToViewTree(rootView, componentView);
|
||||
|
||||
// Store component view at node index, with node as the HOST
|
||||
return rootView[HEADER_OFFSET] = componentView;
|
||||
}
|
||||
|
|
|
@ -193,7 +193,6 @@ export class ComponentFactory<T> extends viewEngine_ComponentFactory<T> {
|
|||
component = createRootComponent(
|
||||
componentView, this.componentDef, rootLView, rootContext, [LifecycleHooksFeature]);
|
||||
|
||||
addToViewTree(rootLView, componentView);
|
||||
refreshDescendantViews(rootLView);
|
||||
safeToRunHooks = true;
|
||||
} finally {
|
||||
|
|
Loading…
Reference in New Issue