File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -56,10 +56,7 @@ describe("useRoutes", () => {
56
56
it ( "Uses the `location` prop instead of context location`" , ( ) => {
57
57
let routes = [
58
58
{ path : "one" , element : < h1 > one</ h1 > } ,
59
- {
60
- path : "two" ,
61
- element : < h1 > two</ h1 > ,
62
- } ,
59
+ { path : "two" , element : < h1 > two</ h1 > } ,
63
60
] ;
64
61
65
62
let renderer : TestRenderer . ReactTestRenderer ;
Original file line number Diff line number Diff line change @@ -441,9 +441,9 @@ export function useRoutes(
441
441
dataRouterStateContext || undefined
442
442
) ;
443
443
444
- // When a user passes in a `locationArg` prop , the associated routes need to
445
- // be wrapped in a `LocationContext.Provider` in order for `useLocation` to
446
- // use the `locationArg` location instead of the global location.
444
+ // When a user passes in a `locationArg`, the associated routes need to
445
+ // be wrapped in a new `LocationContext.Provider` in order for `useLocation`
446
+ // to use the scoped location instead of the global location.
447
447
if ( locationArg ) {
448
448
return (
449
449
< LocationContext . Provider
@@ -463,6 +463,7 @@ export function useRoutes(
463
463
</ LocationContext . Provider >
464
464
) ;
465
465
}
466
+
466
467
return renderedMatches ;
467
468
}
468
469
You can’t perform that action at this time.
0 commit comments