File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed
Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -52,17 +52,13 @@ interface RawNodeDatum {
5252 children ?: RawNodeDatum [ ]
5353 errorBoundary : { hasErrorBoundary : boolean ; errorBoundaryId : string | null }
5454}
55- const routeMap = new Map ( )
55+
5656const constructTree = ( routes : any , parentId ?: string ) : RawNodeDatum [ ] => {
5757 const nodes : RawNodeDatum [ ] = [ ]
5858 const routeKeys = Object . keys ( routes )
5959 for ( const key of routeKeys ) {
6060 const route = routes [ key ]
6161 if ( route . parentId === parentId ) {
62- if ( routeMap . get ( key ) ) {
63- nodes . push ( routeMap . get ( key ) )
64- continue
65- }
6662 const url = convertReactRouterPathToUrl ( routes , route )
6763 const node : RawNodeDatum = {
6864 name : url ,
@@ -73,7 +69,7 @@ const constructTree = (routes: any, parentId?: string): RawNodeDatum[] => {
7369 errorBoundary : findParentErrorBoundary ( route ) ,
7470 children : constructTree ( routes , route . id ) ,
7571 }
76- routeMap . set ( key , node )
72+
7773 nodes . push ( node )
7874 }
7975 }
You can’t perform that action at this time.
0 commit comments