Skip to content

Commit

Permalink
refactor: improve redirect not found page and route (#8)
Browse files Browse the repository at this point in the history
closes #3
  • Loading branch information
takanome-dev authored Sep 17, 2022
1 parent ccc7e32 commit 9da5e11
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion hooks/useContributorData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const useContributorData = () => {
return {
type: "result",
data: data?.data ?? [],
meta: data?.meta ?? { itemCount: 0 },
meta: data?.meta ?? { itemCount: 0 }
// commenting for now to appease build
// mutate
};
Expand Down
12 changes: 12 additions & 0 deletions pages/404.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { useEffect } from "react";
import { useRouter } from "next/router";

export default function Custom404() {
const router = useRouter();

useEffect(() => {
router.replace("/");
});

return null;
}

0 comments on commit 9da5e11

Please sign in to comment.