We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3cd2fef commit e820f4dCopy full SHA for e820f4d
1 file changed
src/routing.ts
@@ -7,6 +7,7 @@ import {
7
createSignal,
8
on,
9
onCleanup,
10
+ onMount,
11
untrack,
12
useContext,
13
startTransition,
@@ -326,6 +327,10 @@ export function createRouterContext(
326
327
}
328
};
329
330
+ const handlePopState = () => setState(window.history.state);
331
+ onMount(() => window.addEventListener("popstate", handlePopState));
332
+ onCleanup(() => window.removeEventListener("popstate", handlePopState));
333
+
334
createRenderEffect(() => {
335
const { value, state } = source();
336
// Untrack this whole block so `start` doesn't cause Solid's Listener to be preserved
0 commit comments