@@ -88,6 +88,11 @@ export default function useRouter({
8888 window.scrollTo(0, 0);
8989 }, [routes]);
9090
91+ useEffect(() => {
92+ // on router mount, register new state with browser
93+ window.history.pushState(null, null, null);
94+ }, []);
95+
9196 // capture browser pop in primary router
9297 useEffect(() => {
9398 // store the previous onpopstate handler
@@ -103,6 +108,8 @@ export default function useRouter({
103108
104109 // on pop, tell the browser of a new state to avoid giving the user
105110 // the ability to go forward
111+ // TODO: allow the user to go forward by storing our data in history
112+ // and using the url for other state
106113 window.history.pushState(null, null, null);
107114
108115 // then update our local state for rendering