Skip to content

Commit

Permalink
Redirect index to what-is-safe server-side (#420)
Browse files Browse the repository at this point in the history
  • Loading branch information
louis-md authored Mar 26, 2024
1 parent bb11423 commit 6b7fc77
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { useRouter } from 'next/router'
import { useEffect } from 'react'
import type { GetStaticProps } from 'next'

const RedirectIndex: React.FC = () => {
const { push } = useRouter()
const RedirectIndex: React.FC = () => <></>

useEffect(() => {
void push('/home/what-is-safe')
}, [push])
export default RedirectIndex

return <></>
export const getStaticProps: GetStaticProps = async () => {
return {
redirect: {
destination: '/home/what-is-safe',
permanent: true
}
}
}

export default RedirectIndex

0 comments on commit 6b7fc77

Please sign in to comment.