React-router-redux takes two clicks on a Link to update location state
Asked Answered
C

0

2

I have an issue with my app that I cannot find solution for anywhere. I use react-router-redux and syncHistoryWithStore.

When I click on my navigation to change a route using Link the new route loads, URL in the browser updates, however the location state doesn't update unless I click the Link two times.

UPDATE: I've noticed it might have something to do with Chrome React DevTools. If I open the React Devtools and select provider then unwrap the components tree one at a time, the location state updates and everything works fine. However, if I use the search bar to locate the target component, location state doesn't work any more and the app breaks. Weird?!

Has anyone encountered a similar issue before? Any idea how to fix this?

Cotyledon answered 19/6, 2016 at 21:48 Comment(2)
are you returning false in any click handlers for your links conditionally? like if something is not setup correctly? aka if the url hasn't changed you could be killing the propagation to not update state before the url actually changes. Not really sure without seeing code thoughFlaxman
I'm having the same issue. The url changes, but it takes another click on the link for the location to actually change.Oversupply

© 2022 - 2024 — McMap. All rights reserved.