After update react-router to version 5.0.0 and connectedReactRouter to version 6.4.0 still having an error in console:
Error: Invariant failed: You should not use
I've ran into this issue before, make sure your react-router and react-router-dom are the same version (5.0) do a npm cache clean or yarn cache clean, remove node_modules and package-lock.json/yarn.lock and do a npm install/yarn install.
@austsinovich have you found any solution to this problem?
i tried clearing out and reinstalling, but it's still not working, changed react-router-dom to: "4.3.1" works
yes. even though react-router-dom ^4.3.1 depends on react-router ^4.3.1, npm decides its funny to install react-router-dom 5.0.0, even though you already have react-router ^4.3.1 installed. A normal package manager would find out that ^4.3.1 is the only matching package version, however npm is not a normal package manager.
I know of no package manager with that many stupid upside down behaviors as npm (not rust, not php, not java, not anything). Yeah but its always some super smart logical reason why that has to do upside down. Like the stupid lockfile behavior. Usually excused because "it was always like that, we want bc, but we created a new executable, which does as you expect", introducing thereby other issues which would never have existed in first place if simply being logical.
Most helpful comment
I've ran into this issue before, make sure your react-router and react-router-dom are the same version (5.0) do a npm cache clean or yarn cache clean, remove node_modules and package-lock.json/yarn.lock and do a npm install/yarn install.