diff --git a/src/components/Error.tsx b/src/components/Error.tsx new file mode 100644 index 0000000..f25b194 --- /dev/null +++ b/src/components/Error.tsx @@ -0,0 +1,3 @@ +export function ErrorComponent() { + return
An unhandled error happened!
+} diff --git a/src/components/NotFount.tsx b/src/components/NotFount.tsx index ee49503..fec55b7 100644 --- a/src/components/NotFount.tsx +++ b/src/components/NotFount.tsx @@ -1,3 +1,3 @@ -export function NotFound() { - return
Not Found
+export function NotFoundComponent() { + return
404 - Not Found
} diff --git a/src/routes/__root.tsx b/src/routes/__root.tsx index f3b1d0c..c652d53 100644 --- a/src/routes/__root.tsx +++ b/src/routes/__root.tsx @@ -1,6 +1,8 @@ import { TanStackDevtools } from '@tanstack/react-devtools' import { createRootRoute, HeadContent, Scripts } from '@tanstack/react-router' import type { ReactNode } from 'react' +import { ErrorComponent } from '@/components/Error' +import { NotFoundComponent } from '@/components/NotFount' import { devtools as queryDevtools } from '@/integrations/tanstack-query' import { devtools as routerDevtools } from '@/integrations/tanstack-router' import appCss from '@/styles.css?url' @@ -27,8 +29,8 @@ export const Route = createRootRoute({ ], }), shellComponent: RootDocument, - errorComponent: () =>
Error
, - notFoundComponent: () =>
404 - Not Found
, + errorComponent: () => , + notFoundComponent: () => , }) function RootDocument({ children }: Readonly<{ children: ReactNode }>) {