I'm building a react native app that renders a singe page web application inside a webview. I want to use the history.replaceState method to alter the current history href, without reloading the entire page. So the history would look like this:
1) ["/"]
2) ["/", "/foo"] after history.pushState
3) ["/", "/bar"] after history.replaceState
This works as expected on Safari and Chrome, but in the webview replaceState pushes a new entry to the end of the stack, so it ends up like this: ["/", "/foo", "/bar"]
How can I have replaceState work as described in the documentation ?