Skip to content

Commit 29f273b

Browse files
committed
Back out formatting change to test
1 parent ca9921d commit 29f273b

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

packages/react-router/__tests__/useRoutes-test.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,7 @@ describe("useRoutes", () => {
5656
it("Uses the `location` prop instead of context location`", () => {
5757
let routes = [
5858
{ path: "one", element: <h1>one</h1> },
59-
{
60-
path: "two",
61-
element: <h1>two</h1>,
62-
},
59+
{ path: "two", element: <h1>two</h1> },
6360
];
6461

6562
let renderer: TestRenderer.ReactTestRenderer;

packages/react-router/lib/hooks.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -441,9 +441,9 @@ export function useRoutes(
441441
dataRouterStateContext || undefined
442442
);
443443

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.
447447
if (locationArg) {
448448
return (
449449
<LocationContext.Provider
@@ -463,6 +463,7 @@ export function useRoutes(
463463
</LocationContext.Provider>
464464
);
465465
}
466+
466467
return renderedMatches;
467468
}
468469

0 commit comments

Comments
 (0)