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

旧城冷巷雨未停 提交于 2019-12-24 01:57:10

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!