Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • 2
    This helped me Michael, Thanks! You might want to change your reference from history and just use BrowserHistory. i.e. browserHistory.listen Commented Jan 27, 2016 at 21:00
  • You're welcome! Glad to help. Also, agreed, and for this particular use case I've updated the snippet to solve a deprecation warning from React Router. Commented Jan 28, 2016 at 21:26
  • 1
    With release of react-router v3.0.0 this doesn't work, because react-router v3.0.0 uses History v3.0.0 Commented Nov 2, 2016 at 21:46
  • Any idea how to prevent history.listen infinite call loop? Caused by replacing the path I guess. Commented Sep 30, 2019 at 12:04