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

__root.tsx

54 lines977 Bytes

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