You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It appears that react-router-component listens to onpopstate() and triggers itself, causing a conflict with my current setup.
When clicking a navigation element in my application, the path store gets updated and through a change-listener my router triggers a re-render. If I hit the back button, I'd like to update the path store with window.location.pathname, and through a change-listener trigger a re-render on my router.
How can I make react-router-component stop triggering on onpopstate() events?
edit: I want to make this work:
functioncomponentDidMount(){// update the state with the new url when the store updatespathStore.on('update',updateUrl.bind(this));// listen to changes to 'pop state' and update the store accordinglywindow.onpopstate=function(){dispatcher.dispatch('path_update',window.location.pathname);};}
The text was updated successfully, but these errors were encountered:
yoshuawuyts
added a commit
to yoshuawuyts/versity-legacy
that referenced
this issue
Jun 12, 2014
It appears that
react-router-component
listens toonpopstate()
and triggers itself, causing a conflict with my current setup.When clicking a navigation element in my application, the
path
store gets updated and through a change-listener my router triggers a re-render. If I hit the back button, I'd like to update thepath
store withwindow.location.pathname
, and through a change-listener trigger a re-render on my router.How can I make
react-router-component
stop triggering ononpopstate()
events?edit: I want to make this work:
The text was updated successfully, but these errors were encountered: