We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 098dccb commit f8f30dfCopy full SHA for f8f30df
.changeset/strange-dodos-mix.md
@@ -0,0 +1,5 @@
1
+---
2
+"@solidjs/router": patch
3
4
+
5
+fix initial state including \_depth
src/routers/Router.ts
@@ -12,9 +12,10 @@ export function Router(props: RouterProps): JSX.Element {
12
if (isServer) return StaticRouter(props);
13
const getSource = () => {
14
const url = window.location.pathname.replace(/^\/+/, "/") + window.location.search;
15
+ const state = window.history.state && window.history.state._depth && Object.keys(window.history.state).length === 1 ? undefined : window.history.state;
16
return {
17
value: url + window.location.hash,
- state: window.history.state
18
+ state
19
}
20
};
21
const beforeLeave = createBeforeLeave();
0 commit comments