File tree Expand file tree Collapse file tree 1 file changed +9
-18
lines changed
src/theme/NotFound/Content Expand file tree Collapse file tree 1 file changed +9
-18
lines changed Original file line number Diff line number Diff line change 1- import React , { useEffect } from "react" ;
2- import { PageMetadata } from "@docusaurus/theme-common" ;
1+ import { useEffect } from "react" ;
32
4- export default function Index ( ) {
3+ export default function NotFound ( ) {
54 useEffect ( ( ) => {
6- window . location . href = "/docs/" ;
7- } , 2000 ) ;
8- [ ] ;
5+ if ( typeof window !== "undefined" ) {
6+ // immediate redirect without adding to browser history
7+ window . location . replace ( "/docs" ) ;
8+ }
9+ } , [ ] ) ;
910
10- return (
11- < >
12- < PageMetadata title = "Redirecting..." />
13- < main className = "margin-vert--xl container" >
14- < div className = "row" >
15- < div className = "col col--6 col--offset-3" >
16- < h1 className = "hero__title" > Redirecting to home page...</ h1 >
17- </ div >
18- </ div >
19- </ main >
20- </ >
21- ) ;
11+ // render nothing (no content shown)
12+ return null ;
2213}
You can’t perform that action at this time.
0 commit comments