问题
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?
来源:https://stackoverflow.com/questions/37912180/react-router-redux-takes-two-clicks-on-a-link-to-update-location-state