Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move node export conditions into default #12716

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .changeset/modern-avocados-admire.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"@react-router/architect": patch
"@react-router/express": patch
"@react-router/node": patch
"react-router-dom": patch
"react-router": patch
---

Fix React context mismatches (e.g. `useHref() may be used only in the context of a <Router> component.`) during development when using libraries that have a peer dependency on React Router. This is done by removing `node` export conditions and merging them into `default` to ensure a single instance of React Router's context is used.
7 changes: 2 additions & 5 deletions packages/react-router-architect/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,14 @@
"typings": "dist/index.d.ts",
"exports": {
".": {
"node": {
"types": "./dist/index.d.ts",
"module-sync": "./dist/index.mjs",
"default": "./dist/index.js"
},
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"default": {
"types": "./dist/index.d.ts",
"module-sync": "./dist/index.mjs",
"module": "./dist/index.mjs",
"default": "./dist/index.js"
}
},
Expand Down
7 changes: 2 additions & 5 deletions packages/react-router-dom/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,14 @@
"types": "./dist/index.d.ts",
"exports": {
".": {
"node": {
"types": "./dist/index.d.ts",
"module-sync": "./dist/index.mjs",
"default": "./dist/index.js"
},
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"default": {
"types": "./dist/index.d.ts",
"module-sync": "./dist/index.mjs",
"module": "./dist/index.mjs",
"default": "./dist/index.js"
}
},
Expand Down
7 changes: 2 additions & 5 deletions packages/react-router-express/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,14 @@
"typings": "dist/index.d.ts",
"exports": {
".": {
"node": {
"types": "./dist/index.d.ts",
"module-sync": "./dist/index.mjs",
"default": "./dist/index.js"
},
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"default": {
"types": "./dist/index.d.ts",
"module-sync": "./dist/index.mjs",
"module": "./dist/index.mjs",
"default": "./dist/index.js"
}
},
Expand Down
14 changes: 4 additions & 10 deletions packages/react-router-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,32 +15,26 @@
"main": "dist/index.js",
"exports": {
".": {
"node": {
"types": "./dist/index.d.ts",
"module-sync": "./dist/index.mjs",
"default": "./dist/index.js"
},
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"default": {
"types": "./dist/index.d.ts",
"module-sync": "./dist/index.mjs",
"module": "./dist/index.mjs",
"default": "./dist/index.js"
}
},
"./install": {
"node": {
"types": "./dist/install.d.ts",
"module-sync": "./dist/install.mjs",
"default": "./dist/install.js"
},
"import": {
"types": "./dist/install.d.mts",
"default": "./dist/install.mjs"
},
"default": {
"types": "./dist/install.d.ts",
"module-sync": "./dist/install.mjs",
"module": "./dist/install.mjs",
"default": "./dist/install.js"
}
},
Expand Down
14 changes: 4 additions & 10 deletions packages/react-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,14 @@
"module": "./dist/development/index.mjs",
"exports": {
".": {
"node": {
"types": "./dist/development/index.d.ts",
"module-sync": "./dist/development/index.mjs",
"default": "./dist/development/index.js"
},
"import": {
"types": "./dist/development/index.d.mts",
"default": "./dist/development/index.mjs"
},
"default": {
"types": "./dist/development/index.d.ts",
"module-sync": "./dist/development/index.mjs",
"module": "./dist/development/index.mjs",
"default": "./dist/development/index.js"
}
},
Expand All @@ -46,17 +43,14 @@
}
},
"./dom": {
"node": {
"types": "./dist/development/dom-export.d.ts",
"module-sync": "./dist/development/dom-export.mjs",
"default": "./dist/development/dom-export.js"
},
"import": {
"types": "./dist/development/dom-export.d.mts",
"default": "./dist/development/dom-export.mjs"
},
"default": {
"types": "./dist/development/dom-export.d.ts",
"module-sync": "./dist/development/dom-export.mjs",
"module": "./dist/development/dom-export.mjs",
"default": "./dist/development/dom-export.js"
}
},
Expand Down
Loading