We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7418a2a commit 0033b60Copy full SHA for 0033b60
src/runRoutes.tsx
@@ -32,9 +32,15 @@ export function runRoutes(
32
33
const hash = document.location.hash.replace(hashReplace, '');
34
35
- // todo: maybe replace with history.replaceState to completely clear the url?
36
- // currently keeps #
37
- document.location.hash = '';
+ try {
+ history.pushState(
+ '',
38
+ document.title,
39
+ window.location.pathname + window.location.search
40
+ );
41
+ } catch (_) {
42
+ window.location.href.substr(0, window.location.href.indexOf('#'));
43
+ }
44
45
// earliest possible bail on any match
46
if (hash.match(errorRoute)) {
0 commit comments