Okay, but with your feedback I'm doing it like this: [code] I still don't see the…
- User
Okay, but with your feedback I'm doing it like this:
tsxexport default () => { const hasMounted = useRef(false); useEffect(() => { if (hasMounted.current) return; const stateAction: StateAction = { variant: "ChangePage", page: { variant: "Admin" } } history.replaceState({ stateAction }, "", window.location.href); const handlePopState = (e: PopStateEvent) => { console.log("Reached 1"); const stateAction: StateAction | undefined = e.state.stateAction; if (!stateAction) return; e.preventDefault(); e.stopPropagation(); vmatch(stateAction, { ChangePage: ({ page }) => changePage(page), TopPagerBack: () => popTopPage() }) } window.addEventListener("popstate", handlePopState); hasMounted.current = true; return () => { window.removeEventListener("popstate", handlePopState); }; }, []); return <span style={{ display: "none" }}></span>; };
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.