From befa7cdd6d9db4a04ca67045d24ed3cf6aaef4b6 Mon Sep 17 00:00:00 2001 From: Asad Ashraf Date: Thu, 22 Dec 2022 01:22:38 +0500 Subject: [PATCH] 404 is shown for 1 second before matching client paths --- src/pages/404.js | 46 ++++++++++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/src/pages/404.js b/src/pages/404.js index 08684f15645..5b5478da75c 100644 --- a/src/pages/404.js +++ b/src/pages/404.js @@ -15,25 +15,31 @@ import {sharedStyles} from 'theme'; type Props = { location: Location, }; - -const PageNotFound = ({location}: Props) => ( - - -
-
-
Page Not Found
- -
-

We couldn't find what you were looking for.

-

- Please contact the owner of the site that linked you to the - original URL and let them know their link is broken. -

-
-
-
-
-
-); +const PageNotFound = ({location}: Props) => { + const browser = typeof window !== 'undefined' && window; + return ( +
+ {browser && ( + + +
+
+
Page Not Found
+ +
+

We couldn't find what you were looking for.

+

+ Please contact the owner of the site that linked you to the + original URL and let them know their link is broken. +

+
+
+
+
+
+ )} +
+ ); +}; export default PageNotFound;