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:
the user is on page /page1;
then he clicked some button and he is redirected to /page2 url;
on that /page2 page there is some useEffect that must replace the current url to /page3, useEffect(() => history.replace('/page3'), []);
user is redirected to /page3 url;
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.
After upgrading from
6.6.1
to6.9.2
version I have found bugs in my application that callinghistory.replace
does not replace the current url, but acting likepush
, I mean it stores the previously stored path in history. So clicking back button in browser does not skip this replaced path. For example:/page1
;/page2
url;/page2
page there is someuseEffect
that must replace the current url to/page3
,useEffect(() => history.replace('/page3'), [])
;/page3
url;/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.