acdlite / redux-router

Redux bindings for React Router – keep your router state inside your Redux store
MIT License
2.3k stars 200 forks source link

How to force reload on the same current path. #184

Closed joonhocho closed 8 years ago

joonhocho commented 8 years ago

I noticed that router ignores replaceState when it is to the path that is same as the current path. I want to re-fetch all data when user logs in while staying at the same url. How can I accomplish this?

Scarysize commented 8 years ago

Hey, i guess you have some actions you dispatch for fetching the data, or maybe just some regular sub-routine. Either way, you should somehow be able to differentiate if a user is logged in or not (eg. you set a isLoggedIn flag in your redux store). You then can just use React´s lifecycle hooks to re-fetch your data with the previously mentioned methods (sub-routine, action-creator...).

Also try using stackoverflow for asking questions, it is a much better platform for this purpose. EDIT: Also you can just hit us up in the redux-router Discord channel ;-)