diff --git a/pages/index.tsx b/pages/index.tsx index 79f33ac1..176dccb6 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -1,14 +1,14 @@ -import type { GetStaticProps } from 'next' +import { useRouter } from 'next/router' +import { useEffect } from 'react' -const RedirectIndex: React.FC = () => <> +const RedirectIndex: React.FC = () => { + const { push } = useRouter() -export default RedirectIndex + useEffect(() => { + void push('/home/what-is-safe') + }, [push]) -export const getStaticProps: GetStaticProps = async () => { - return { - redirect: { - destination: '/home/what-is-safe', - permanent: true - } - } + return <> } + +export default RedirectIndex