diff --git a/.gitignore b/.gitignore index a547bf3..c3bb0db 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,6 @@ dist-ssr *.njsproj *.sln *.sw? + +# Local Netlify folder +.netlify diff --git a/public/_redirects b/public/_redirects new file mode 100644 index 0000000..4562abd --- /dev/null +++ b/public/_redirects @@ -0,0 +1,2 @@ +/* /index.html 200 + diff --git a/src/views/ErrorPage/NotFoundPage.tsx b/src/views/ErrorPage/NotFoundPage.tsx index 03d0635..b753c77 100644 --- a/src/views/ErrorPage/NotFoundPage.tsx +++ b/src/views/ErrorPage/NotFoundPage.tsx @@ -1,16 +1,23 @@ import { useRouteError } from 'react-router-dom' +type TError = { + statusText: string + message: string +} + export default function NotFoundPage() { - const error: Record | unknown = useRouteError() + const error = useRouteError() as TError console.error(error) return (

Oops!

Sorry, an unexpected error has occurred.

-

- {error.statusText || error.message} -

+ {error && ( +

+ {error?.statusText || error?.message} +

+ )}
) }