Skip to content

Commit

Permalink
Fix plumbing of future prop
Browse files Browse the repository at this point in the history
  • Loading branch information
brophdawg11 committed Dec 5, 2023
1 parent 1c6f3b3 commit 558d793
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 10 deletions.
6 changes: 6 additions & 0 deletions .changeset/empty-ligers-walk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"react-router-dom": patch
"react-router": patch
---

[REMOVE] Fix plumbing of future flags
6 changes: 3 additions & 3 deletions packages/react-router-dom/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -667,9 +667,6 @@ export function RouterProvider({
navigator,
static: false,
basename,
future: {
v7_relativeSplatPath: router.future.v7_relativeSplatPath,
},
}),
[router, navigator, basename]
);
Expand All @@ -691,6 +688,9 @@ export function RouterProvider({
location={state.location}
navigationType={state.historyAction}
navigator={navigator}
future={{
v7_relativeSplatPath: router.future.v7_relativeSplatPath,
}}
>
{state.initialized ? (
<DataRoutes
Expand Down
10 changes: 4 additions & 6 deletions packages/react-router/lib/components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,6 @@ export function RouterProvider({
navigator,
static: false,
basename,
future: {
v7_relativeSplatPath: router.future.v7_relativeSplatPath,
},
}),
[router, navigator, basename]
);
Expand All @@ -171,6 +168,9 @@ export function RouterProvider({
location={state.location}
navigationType={state.historyAction}
navigator={navigator}
future={{
v7_relativeSplatPath: router.future.v7_relativeSplatPath,
}}
>
{state.initialized ? (
<DataRoutes
Expand Down Expand Up @@ -396,9 +396,7 @@ export interface RouterProps {
navigationType?: NavigationType;
navigator: Navigator;
static?: boolean;
future?: {
v7_relativeSplatPath?: boolean;
};
future?: Partial<Pick<FutureConfig, "v7_relativeSplatPath">>;
}

/**
Expand Down
5 changes: 4 additions & 1 deletion packages/react-router/lib/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ export interface RouteMatch<

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

export interface DataRouterContextObject extends NavigationContextObject {
export interface DataRouterContextObject
// Omit `future` since those can be pulled from the `router`
// `NavigationContext` needs future since it doesn't have a `router` in all cases
extends Omit<NavigationContextObject, "future"> {
router: Router;
staticContext?: StaticHandlerContext;
}
Expand Down

0 comments on commit 558d793

Please sign in to comment.