Skip to content

Commit 558d793

Browse files
committed
Fix plumbing of future prop
1 parent 1c6f3b3 commit 558d793

File tree

4 files changed

+17
-10
lines changed

4 files changed

+17
-10
lines changed

.changeset/empty-ligers-walk.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"react-router-dom": patch
3+
"react-router": patch
4+
---
5+
6+
[REMOVE] Fix plumbing of future flags

packages/react-router-dom/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -667,9 +667,6 @@ export function RouterProvider({
667667
navigator,
668668
static: false,
669669
basename,
670-
future: {
671-
v7_relativeSplatPath: router.future.v7_relativeSplatPath,
672-
},
673670
}),
674671
[router, navigator, basename]
675672
);
@@ -691,6 +688,9 @@ export function RouterProvider({
691688
location={state.location}
692689
navigationType={state.historyAction}
693690
navigator={navigator}
691+
future={{
692+
v7_relativeSplatPath: router.future.v7_relativeSplatPath,
693+
}}
694694
>
695695
{state.initialized ? (
696696
<DataRoutes

packages/react-router/lib/components.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,6 @@ export function RouterProvider({
149149
navigator,
150150
static: false,
151151
basename,
152-
future: {
153-
v7_relativeSplatPath: router.future.v7_relativeSplatPath,
154-
},
155152
}),
156153
[router, navigator, basename]
157154
);
@@ -171,6 +168,9 @@ export function RouterProvider({
171168
location={state.location}
172169
navigationType={state.historyAction}
173170
navigator={navigator}
171+
future={{
172+
v7_relativeSplatPath: router.future.v7_relativeSplatPath,
173+
}}
174174
>
175175
{state.initialized ? (
176176
<DataRoutes
@@ -396,9 +396,7 @@ export interface RouterProps {
396396
navigationType?: NavigationType;
397397
navigator: Navigator;
398398
static?: boolean;
399-
future?: {
400-
v7_relativeSplatPath?: boolean;
401-
};
399+
future?: Partial<Pick<FutureConfig, "v7_relativeSplatPath">>;
402400
}
403401

404402
/**

packages/react-router/lib/context.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,10 @@ export interface RouteMatch<
7070

7171
export interface DataRouteMatch extends RouteMatch<string, DataRouteObject> {}
7272

73-
export interface DataRouterContextObject extends NavigationContextObject {
73+
export interface DataRouterContextObject
74+
// Omit `future` since those can be pulled from the `router`
75+
// `NavigationContext` needs future since it doesn't have a `router` in all cases
76+
extends Omit<NavigationContextObject, "future"> {
7477
router: Router;
7578
staticContext?: StaticHandlerContext;
7679
}

0 commit comments

Comments
 (0)