supasate / connected-react-router

A Redux binding for React Router v4
MIT License
4.73k stars 593 forks source link

`history.replace` is not working after upgrading to 6.9.2 version #572

Open Pareder opened 2 years ago

Pareder commented 2 years ago

After upgrading from 6.6.1 to 6.9.2 version I have found bugs in my application that calling history.replace does not replace the current url, but acting like push, I mean it stores the previously stored path in history. So clicking back button in browser does not skip this replaced path. For example:

  1. the user is on page /page1;
  2. then he clicked some button and he is redirected to /page2 url;
  3. on that /page2 page there is some useEffect that must replace the current url to /page3, useEffect(() => history.replace('/page3'), []);
  4. user is redirected to /page3 url;
  5. when clicking browser back button he is redirected to /page2 but he must be redirected to /page1, that's how replace should work and previously worked.

I did not change any code, just upgraded this package.

kylemh commented 2 years ago

@Pareder by any chance did you find the culprit version with the problem? Trying to decide how I should roll back.