Roman Karagodin
Roman Karagodin

Reputation: 859

Connected-react-router doesn't work with React 18

I have encountered a problem when trying to install connected-react-router in my test project on React 18: npm installation fails with an error:

npm ERR! Found: [email protected]

npm ERR! node_modules/react

npm ERR! react@"^18.1.0" from the root project

npm ERR! npm ERR! Could not resolve dependency

npm ERR! peer react@"^16.4.0 || ^17.0.0" from [email protected] or similar packages with

I found information in the repository of connected-react-router that:

v6.0.0 requires React v16.4.0 and React Redux v6.0 / v7.0.

So, I have questions: 1) is connected-react-router maintained? The date of last commits is 7 months ago; 2) are there any similar packages to connect router in React 18 project? Or any inbuilt functionality added in React 18?

Of course, connecting React router to Redux store manually is not difficult at all, but I'm interested in ready solutions. Also I have been searching on the topic, but I can't find any info. Thanks in advance for answers.

Upvotes: 5

Views: 9281

Answers (1)

Mark Wasfy
Mark Wasfy

Reputation: 298

just put that flag to ignore the old react verison npm i connected-react-router --legacy-peer-deps

Upvotes: 6

Related Questions