File tree Expand file tree Collapse file tree 3 files changed +10
-20
lines changed
src/components/router/utils Expand file tree Collapse file tree 3 files changed +10
-20
lines changed Original file line number Diff line number Diff line change 3131 " loader/"
3232 ],
3333 "dependencies" : {
34- "@stencil/core" : " 4.36.0 " ,
34+ "@stencil/core" : " 4.36.1 " ,
3535 "ionicons" : " ^7.2.2" ,
3636 "tslib" : " ^2.1.0"
3737 },
Original file line number Diff line number Diff line change @@ -37,23 +37,13 @@ export const readRoutes = (root: Element): RouteChain[] => {
3737 return flattenRouterTree ( readRouteNodes ( root ) ) ;
3838} ;
3939
40- /**
41- * Stencil patches `elm.children` to behave like calling `elm.children` on an
42- * element with shadow DOM even though the `ion-router` is not a shadow DOM element.
43- * To allow the `ion-router` to work properly we need to access the original accessor
44- * for this property which is `__children`.
45- */
46- interface PatchedStencilElement extends Element {
47- __children ?: HTMLCollection ;
48- }
49-
5040/**
5141 * Reads the route nodes as a tree modeled after the DOM tree of <ion-route> elements.
5242 *
5343 * Note: routes without a component are ignored together with their children.
5444 */
55- export const readRouteNodes = ( node : PatchedStencilElement ) : RouteTree => {
56- return ( Array . from ( node . __children ?? [ ] ) as HTMLIonRouteElement [ ] )
45+ export const readRouteNodes = ( node : Element ) : RouteTree => {
46+ return ( Array . from ( node . children ) as HTMLIonRouteElement [ ] )
5747 . filter ( ( el ) => el . tagName === 'ION-ROUTE' && el . component )
5848 . map ( ( el ) => {
5949 const component = readProp ( el , 'component' ) as string ;
You can’t perform that action at this time.
0 commit comments