diff --git a/src/hooks/useHashRedirect.ts b/src/hooks/useHashRedirect.ts index 3606289fc..ac0396779 100644 --- a/src/hooks/useHashRedirect.ts +++ b/src/hooks/useHashRedirect.ts @@ -1,10 +1,7 @@ import { useEffect } from "react"; -import { useRouter } from "next/router"; import { hashRedirects } from "../../redirects"; export function useHashRedirect() { - const router = useRouter(); - useEffect(() => { const hash = window.location.hash; @@ -13,9 +10,7 @@ export function useHashRedirect() { const redirect = hashRedirects.find( redirect => redirect.source === hash, ); - - if (redirect) router.push(redirect.destination); - }, [router]); - - return; -} + + if (redirect) window.location.replace(redirect.destination); + }, []); +} \ No newline at end of file