Skip to content

Commit 081a9ef

Browse files
committed
added redirect after 2 seconds delay
Signed-off-by: amaan287 <amaanmirza287@gmail.com> Signed-off-by: Amaan Mirza <amaanmirza287@gmail.com>
1 parent 9203847 commit 081a9ef

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

src/theme/NotFound/Content/index.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
1-
import React from "react";
2-
import {PageMetadata} from "@docusaurus/theme-common";
1+
import React, { useEffect } from "react";
2+
import { PageMetadata } from "@docusaurus/theme-common";
33
import Link from "@docusaurus/Link";
44
import useBaseUrl from "@docusaurus/useBaseUrl";
55

6+
67
export default function Index() {
8+
useEffect(() => {
9+
const timer = setTimeout(() => {
10+
window.location.href = "/docs/";
11+
}, 2000);
12+
13+
14+
return () => clearTimeout(timer);
15+
}, []);
16+
717
return (
818
<>
919
<PageMetadata title="Page Not Found" />
@@ -81,7 +91,7 @@ export default function Index() {
8191
</Link>
8292
</div>
8393

84-
94+
8595
</div>
8696
</main>
8797
</>

0 commit comments

Comments
 (0)