redirect on client for 404
This commit is contained in:
@@ -1,12 +1,14 @@
|
|||||||
export default function NotFound() {}
|
import { useRouter } from "next/router";
|
||||||
|
import { useEffect } from "react";
|
||||||
|
|
||||||
// Temporary. Move to app/ directory when it's supported
|
// Temporary. Move to app/ directory when it's supported
|
||||||
|
|
||||||
export function getStaticProps() {
|
export default function NotFound() {
|
||||||
return {
|
const router = useRouter();
|
||||||
redirect: {
|
|
||||||
destination: "/",
|
useEffect(() => {
|
||||||
permanent: true
|
router.replace("/");
|
||||||
}
|
});
|
||||||
};
|
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user