fix(ivy): generate empty QueryList for root component content queries (#29514)
In View Engine, we used to generate empty QueryLists for content queries on root components (though we did not actually support populating these lists). We need to keep this behavior in Ivy for backwards compatibility. Otherwise, components that are sometimes used as root will fail if they are relying on content query results to always be defined. PR Close #29514
This commit is contained in:

committed by
Miško Hevery

parent
568140fb03
commit
9724247ad8
@ -217,6 +217,12 @@ export function createRootComponent<T>(
|
||||
renderInitialStyles(native, rootTNode.stylingTemplate, componentView[RENDERER]);
|
||||
}
|
||||
|
||||
// We want to generate an empty QueryList for root content queries for backwards
|
||||
// compatibility with ViewEngine.
|
||||
if (componentDef.contentQueries) {
|
||||
componentDef.contentQueries(RenderFlags.Create, component, rootView.length - 1);
|
||||
}
|
||||
|
||||
return component;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user