Skip to content

Commit fdff9dd

Browse files
authored
Fix react-router-dom/server index.ts import from pnpm migration (#11514)
1 parent e0b1db4 commit fdff9dd

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

.changeset/little-ghosts-give.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"react-router-dom": patch
3+
---
4+
5+
Change the `react-router-dom/server` import back to `react-router-dom` instead of `index.ts`

packages/react-router-dom/server.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import type {
2929
Location,
3030
RouteObject,
3131
To,
32-
} from "./index";
32+
} from "react-router-dom";
3333
import {
3434
createPath,
3535
parsePath,
@@ -38,7 +38,7 @@ import {
3838
UNSAFE_DataRouterStateContext as DataRouterStateContext,
3939
UNSAFE_FetchersContext as FetchersContext,
4040
UNSAFE_ViewTransitionContext as ViewTransitionContext,
41-
} from "./index";
41+
} from "react-router-dom";
4242

4343
export interface StaticRouterProps {
4444
basename?: string;

packages/react-router-dom/tsconfig.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@
1616
"skipLibCheck": true,
1717

1818
"outDir": ".",
19-
"rootDir": "."
19+
"rootDir": ".",
20+
21+
// Needed for the more-strict pnpm setup, can be removed in v7 since we'll
22+
// be collapsing the lifted server file into the main package export
23+
"paths": {
24+
"react-router-dom": ["./index.tsx"]
25+
}
2026
}
2127
}

0 commit comments

Comments
 (0)