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

__root.tsx

51 lines830 Bytes

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