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

__root.tsx

30 lines706 Bytes

1/// <reference types="vite/client" />
2import { HeadContent, Scripts, createRootRoute } from '@tanstack/react-router'
3import { Shell } from '~/components/Shell'
4import type { ReactNode } from 'react'
5​
6export const Route = createRootRoute({
7 head: () => ({
8 meta: [
9 { charSet: 'utf-8' },
10 { name: 'viewport', content: 'width=device-width, initial-scale=1' },
11 { title: 'Inline CSS E2E' },
12 ],
13 }),
14 component: Shell,
15 shellComponent: RootDocument,
16})
17​
18function RootDocument({ children }: { children: ReactNode }) {
19 return (
20 <html lang="en">
21 <head>
22 <HeadContent />
23 </head>
24 <body>
25 {children}
26 <Scripts />
27 </body>
28 </html>
29 )