File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
packages/react-router/lib Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " react-router " : patch
3
+ ---
4
+
5
+ Limit matchRoutes optimization to client side routers
Original file line number Diff line number Diff line change @@ -359,7 +359,7 @@ export function useRoutesImpl(
359
359
`useRoutes() may be used only in the context of a <Router> component.`
360
360
) ;
361
361
362
- let { navigator } = React . useContext ( NavigationContext ) ;
362
+ let { navigator, static : isStatic } = React . useContext ( NavigationContext ) ;
363
363
let { matches : parentMatches } = React . useContext ( RouteContext ) ;
364
364
let routeMatch = parentMatches [ parentMatches . length - 1 ] ;
365
365
let parentParams = routeMatch ? routeMatch . params : { } ;
@@ -447,6 +447,7 @@ export function useRoutesImpl(
447
447
}
448
448
449
449
let matches =
450
+ ! isStatic &&
450
451
dataRouterState &&
451
452
dataRouterState . matches &&
452
453
dataRouterState . matches . length > 0
You can’t perform that action at this time.
0 commit comments