supasate / connected-react-router

A Redux binding for React Router v4
MIT License
4.73k stars 593 forks source link

Is connected-react-router compatible with react 18? #578

Open chris-tuncap opened 2 years ago

chris-tuncap commented 2 years ago

Is the latest version (6.9.2) compatible with react 18?

D3Pheonix commented 2 years ago

i think yes, but it's not compatible with router v6 (

petatemarvin26 commented 1 year ago

The alternative one redux-first-history, it is compatible to react-router@v6 but if you are still wanted to use connected-react-router you need to downgrade your react-router to v5

N1mi1 commented 1 year ago

ATM you can see package.json

"peerDependencies": { "history": "^4.7.2", "react": "^16.4.0 || ^17.0.0", "react-redux": "^6.0.0 || ^7.1.0", "react-router": "^4.3.1 || ^5.0.0", "redux": "^3.6.0 || ^4.0.0" },

So it seems that no. Also when you run npm i connected-react-router you get an error: npm ERR! Found: react@18.2.0 npm ERR! node_modules/react npm ERR! react@"^18.2.0" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer react@"^16.4.0 || ^17.0.0" from connected-react-router@6.9.3

rajputanax commented 1 year ago

can we use router 4.3.2 with react 18

0bx commented 1 year ago

For React 18 / Router 6 / Redux 8 setup one may use another library: https://github.com/lagunovsky/redux-react-router which is compatible with connected-react-router APIs.

VivekTiwari97 commented 2 months ago

I'm stuck in same propblem, using ract 18.3 , when try to npm i getting error Could not resolve dependency: npm ERR! peer react@"^16.4.0 || ^17.0.0" from connected-react-router@6.9.3 npm ERR! node_modules/connected-react-router npm ERR! connected-react-router@"^6.9.3" from the root project

VivekTiwari97 commented 2 months ago

what is solution, should i go to previous version of "connect-react-router", or previous version of react.?

geobde commented 1 month ago

any update?

vanoMekantsishvili commented 2 weeks ago

Any updates?

Maximumz commented 1 day ago

Possible work around till the package is updated use the --legacy-peer-deps flag

npm i connected-react-router --legacy-peer-deps or npm i --legacy-peer-deps

But warning this could introduce breaking changes & needs to be tested thoroughly