Files
full-stack-fastapi-template/frontend/src/routes/__root.tsx

26 lines
612 B
TypeScript
Raw Normal View History

2024-03-17 17:28:45 +01:00
import { Outlet, createRootRoute } from "@tanstack/react-router"
import React, { Suspense } from "react"
2024-03-08 14:58:36 +01:00
2024-03-17 17:28:45 +01:00
import NotFound from "../components/Common/NotFound"
const TanStackRouterDevtools =
2024-03-17 17:28:45 +01:00
process.env.NODE_ENV === "production"
? () => null
: React.lazy(() =>
2024-03-17 17:28:45 +01:00
import("@tanstack/router-devtools").then((res) => ({
default: res.TanStackRouterDevtools,
})),
)
export const Route = createRootRoute({
2024-03-08 14:58:36 +01:00
component: () => (
<>
<Outlet />
<Suspense>
<TanStackRouterDevtools />
</Suspense>
2024-03-08 14:58:36 +01:00
</>
),
notFoundComponent: () => <NotFound />,
})