I am using react-router-dom props.history.replace
to replace query string in URL (works as expected).
When I navigate to another URL using Link
component and hit back, URL doesn't reflect previous push state (set using props.history.replace
).
For example: we're at /privacy-guides
and search for keyword veracrypt
.
Following logic is executed:
props.history.replace({
pathname: "/privacy-guides",
search: queryString.stringify({
search: value,
}),
})
We're now at /privacy-guides?search=veracrypt
.
We click on <Link to="/privacy-guides/how-to-backup-and-encrypt-data-using-rsync-and-veracrypt-on-macos">
.
We're now at /privacy-guides/how-to-backup-and-encrypt-data-using-rsync-and-veracrypt-on-macos
and click back button.
We're now at /privacy-guides
vs expected /privacy-guides?search=veracrypt
.
Why?