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

Upgrade peer dependencies to support React 18 #585

Open
SubbaramiReddy-y opened this issue Aug 25, 2022 · 1 comment
Open

Upgrade peer dependencies to support React 18 #585

SubbaramiReddy-y opened this issue Aug 25, 2022 · 1 comment

Comments

@SubbaramiReddy-y
Copy link

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch [email protected] for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/connected-react-router/package.json b/node_modules/connected-react-router/package.json
index 2c5b11b..3d3b210 100644
--- a/node_modules/connected-react-router/package.json
+++ b/node_modules/connected-react-router/package.json
@@ -33,7 +33,7 @@
   },
   "peerDependencies": {
     "history": "^4.7.2",
-    "react": "^16.4.0 || ^17.0.0",
+    "react": "^16.4.0 || ^17.0.0 || ^18.2.0",
     "react-redux": "^6.0.0 || ^7.1.0",
     "react-router": "^4.3.1 || ^5.0.0",
     "redux": "^3.6.0 || ^4.0.0"

This issue body was partially generated by patch-package.

@kostenko
Copy link

kostenko commented Feb 1, 2023

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch [email protected] for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/connected-react-router/package.json b/node_modules/connected-react-router/package.json
index 2c5b11b..3d3b210 100644
--- a/node_modules/connected-react-router/package.json
+++ b/node_modules/connected-react-router/package.json
@@ -33,7 +33,7 @@
   },
   "peerDependencies": {
     "history": "^4.7.2",
-    "react": "^16.4.0 || ^17.0.0",
+    "react": "^16.4.0 || ^17.0.0 || ^18.2.0",
     "react-redux": "^6.0.0 || ^7.1.0",
     "react-router": "^4.3.1 || ^5.0.0",
     "redux": "^3.6.0 || ^4.0.0"

This issue body was partially generated by patch-package.

if you're like me and never used patch-package, the command needs to override the default value in the exclude option — to include package.json, otherwise it won't see the patch

npx patch-package connected-react-router --exclude

and, more importantly, it didn't solve the issue — npm i still failed with

npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/react
npm ERR!   react@"18.2.0" from the root project
npm ERR!   peer react@">=15" from [email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants