refactor(ivy): remove code duplication around root component view creation (#31946)

PR Close #31946
This commit is contained in:
Pawel Kozlowski 2019-08-01 15:19:34 +02:00 committed by Alex Rickabaugh
parent a7c71d1a57
commit 32e2f4daef
2 changed files with 2 additions and 3 deletions

View File

@ -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;
}

View File

@ -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 {