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

__root.tsx

47 lines819 Bytes

1import * as React from 'react'
2import {
3 HeadContent,
4 Outlet,
5 Scripts,
6 createRootRoute,
7} from '@tanstack/react-router'
8​
9export const Route = createRootRoute({
10 head: () => ({
11 meta: [
12 {
13 charSet: 'utf-8',
14 },
15 {
16 name: 'viewport',
17 content: 'width=device-width, initial-scale=1',
18 },
19 {
20 title: 'TanStack Start Starter',
21 },
22 ],
23 }),
24 component: RootComponent,
25})
26​
27function RootComponent() {
28 return (
29 <RootDocument>
30 <Outlet />
31 </RootDocument>
32 )
34​
35function RootDocument({ children }: { children: React.ReactNode }) {
36 return (
37 <html>
38 <head>
39 <HeadContent />
40 </head>
41 <body style={{ margin: 0, padding: 0, height: '100vh' }}>
42 {children}
43 <Scripts />
44 </body>
45 </html>
46 )