From fdff9ddfd3b929b6750f750523b77649d1421e60 Mon Sep 17 00:00:00 2001 From: Matt Brophy Date: Tue, 30 Apr 2024 09:30:05 -0400 Subject: [PATCH] Fix react-router-dom/server index.ts import from pnpm migration (#11514) --- .changeset/little-ghosts-give.md | 5 +++++ packages/react-router-dom/server.tsx | 4 ++-- packages/react-router-dom/tsconfig.json | 8 +++++++- 3 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 .changeset/little-ghosts-give.md diff --git a/.changeset/little-ghosts-give.md b/.changeset/little-ghosts-give.md new file mode 100644 index 0000000000..e3fe8207f0 --- /dev/null +++ b/.changeset/little-ghosts-give.md @@ -0,0 +1,5 @@ +--- +"react-router-dom": patch +--- + +Change the `react-router-dom/server` import back to `react-router-dom` instead of `index.ts` diff --git a/packages/react-router-dom/server.tsx b/packages/react-router-dom/server.tsx index 3195c3d271..9fcb91b173 100644 --- a/packages/react-router-dom/server.tsx +++ b/packages/react-router-dom/server.tsx @@ -29,7 +29,7 @@ import type { Location, RouteObject, To, -} from "./index"; +} from "react-router-dom"; import { createPath, parsePath, @@ -38,7 +38,7 @@ import { UNSAFE_DataRouterStateContext as DataRouterStateContext, UNSAFE_FetchersContext as FetchersContext, UNSAFE_ViewTransitionContext as ViewTransitionContext, -} from "./index"; +} from "react-router-dom"; export interface StaticRouterProps { basename?: string; diff --git a/packages/react-router-dom/tsconfig.json b/packages/react-router-dom/tsconfig.json index a84a59018c..c01508b4ef 100644 --- a/packages/react-router-dom/tsconfig.json +++ b/packages/react-router-dom/tsconfig.json @@ -16,6 +16,12 @@ "skipLibCheck": true, "outDir": ".", - "rootDir": "." + "rootDir": ".", + + // Needed for the more-strict pnpm setup, can be removed in v7 since we'll + // be collapsing the lifted server file into the main package export + "paths": { + "react-router-dom": ["./index.tsx"] + } } }