salvoravida/redux-first-history

window.location mismatch with redux router state location.

agarwal-nitesh opened this issue · 4 comments

React router version - 6.2.2
reudx-first-history version - 5.0.8
I have 3 routes:
landing - /
login - /login
signup - /signup

From landing, I navigate to login, if a user is not authorized using reduxFirsthistory.push.
From login on clicking signup I navigate to signup using useNavigate.
If I now goto the landing / path, I end up on signup. The redux router state location path is signup, whereas the window location path is /

Thanks for the library, I am a little new to these concepts so it can be a major PEBCAK situation. I am able to reproduce it, though. At the same time, it might be, that this is how it's supposed to work.

Hi, can you provide a code sandbox example?

https://codesandbox.io/s/crazy-meadow-9urrru?file=/src/App.js

There seems to be some problem with the persist-gate in sandbox related to import. Clear local storage and reload.

@agarwal-nitesh Sorry can't understand where is the problem. Can you describe the exact steps to reproduce?

@agarwal-nitesh feel free to re-open as soon as the codesandbox is working