From 8291202c16bddaf32b2fee87367feb47d25205a1 Mon Sep 17 00:00:00 2001 From: sai nikhil kethe Date: Tue, 14 May 2024 06:08:35 +0000 Subject: [PATCH] redirect to home fixed --- src/app/not-found.tsx | 68 ++++++++++++++++++++++--------------------- 1 file changed, 35 insertions(+), 33 deletions(-) diff --git a/src/app/not-found.tsx b/src/app/not-found.tsx index 2e7c748b8..2e1f919ef 100644 --- a/src/app/not-found.tsx +++ b/src/app/not-found.tsx @@ -1,39 +1,41 @@ 'use client'; -import Link from 'next/link'; +import { useRouter } from 'next/navigation'; +import { useEffect } from 'react'; export default function GlobalError() { + const router = useRouter(); + useEffect(() => { + // Set the title dynamically + document.title = '404: Page could not be found'; + }, []); + const handleClick = () => { + document.title = + 'Take your development skills from 0 to 100 and join the 100xdevs community'; + router.push('/'); + }; return ( - - - 404: Page could not be found - - -
-

404

-

Oops! Page Not Found.

-
- - - -
- - {' '} - Go back to Home{' '} - +
+

404

+

Oops! Page Not Found.

+
+ + + +
+ +
); }