Skip to content
Source
Sign inSign up
TanStack/db
Open History to see the last commit

__root.tsx

53 lines939 Bytes

1import {
2 Outlet,
3 HeadContent,
4 Scripts,
5 createRootRoute,
6} from "@tanstack/react-router"
7import { TanStackRouterDevtools } from "@tanstack/react-router-devtools"
8​
9import appCss from "../styles.css?url"
10​
11export const Route = createRootRoute({
12 head: () => ({
13 meta: [
14 {
15 charSet: `utf-8`,
16 },
17 {
18 name: `viewport`,
19 content: `width=device-width, initial-scale=1`,
20 },
21 {
22 title: `TanStack DB Projects Example`,
23 },
24 ],
25 links: [
26 {
27 rel: `stylesheet`,
28 href: appCss,
29 },
30 ],
31 }),
32​
33 component: () => (
34 <RootDocument>
35 <Outlet />
36 <TanStackRouterDevtools />
37 </RootDocument>
38 ),
39})
40​
41function RootDocument({ children }: { children: React.ReactNode }) {
42 return (
43 <html lang="en">
44 <head>
45 <HeadContent />
46 </head>
47 <body>
48 {children}
49 <Scripts />
50 </body>
51 </html>
52 )