Skip to content

Commit

Permalink
Add custom 404 page that redirects to home
Browse files Browse the repository at this point in the history
  • Loading branch information
Serubin committed Mar 22, 2024
1 parent cdf23a4 commit 2a9f44f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pages/404.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import type { NextPage } from 'next';
import { useRouter } from 'next/navigation';
import { useEffect } from 'react';

// This custom 404 page will just redirect to /
// This is fine for this site because there are only two pages
const NotFound: NextPage = (): void => {
const { push } = useRouter();
useEffect(() => push('/'));
};
export default NotFound;

0 comments on commit 2a9f44f

Please sign in to comment.