DEV Community

loading...

Discussion on: Programmatic Navigation in React using react-router

Collapse
rusikf profile image
Ruslan Korolev

The last way - add utils/history, add this to BrowserRouter + trying to use this constant in redux action doesnt work. It changes url, but react-router don't render component
Looks, the problem because we create 2 instances of createHistory, Details - github.com/ReactTraining/react-rou...

Other ways works, thanks for article!

Collapse
projectescape profile image
Aniket Author

Glad you liked it. But you sure the last way is not working? I'm positive it was working when I wrote this post, I also linked my repo which has the code I wrote back then. I have used Router instead of BrowserRouter, as BrowserRouter comes with its own history

Collapse
rusikf profile image
Ruslan Korolev

Amazing, it works when I tried to use Router! Thanks a lot !!