maisano / react-router-transition

painless transitions built for react-router, powered by react-motion
http://maisano.github.io/react-router-transition/
MIT License
2.59k stars 138 forks source link

Broken on newest react for me #102

Closed wrightwriter closed 5 years ago

wrightwriter commented 5 years ago

throws the following error

You should not use <Route> or withRouter() outside a <Router>

when using AnimatedSwitch

idmadj commented 5 years ago

Hey @wrightwriter, can you try switching your project to 'idmadj/react-router-transition#fix-102' and see if it fixes your issue? Looks like react-router-transition uses a now deprecated way of importing the react-router classes.

ogostus commented 5 years ago

Hey @wrightwriter, can you try switching your project to 'idmadj/react-router-transition#fix-102' and see if it fixes your issue? Looks like react-router-transition uses a now deprecated way of importing the react-router classes.

have same issue and your fix is not working for me

Vija02 commented 5 years ago

It seems like the context changes onreact-router v4.4.0 forces you to import the code from the same place.

I got it working by changing react-router-dom into a peerDependency in addition with @idmadj's changes.

I'll whip up a PR when there's time

nightspirit commented 5 years ago

https://reacttraining.com/blog/react-router-v5/

react-router team unpublished v4.4.0 and bump up the version to v5.0.0 peerDependency might need to change

"react-router-dom": "^4.1.1 || ^5.0.0"