In React-Router, don’t use window.history.pushState(), but History.push()

window.history.pushState() won’t be recognised by react-router’s observer. So what will happen is that the url of the browser will be changed, but the corresponding component won’t be loaded.

React Router is based on History API, and History.push() will work.

Leave a Comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.