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

__root.tsx

47 lines1.0 KB

1import { HeadContent, Scripts, createRootRoute } from '@tanstack/react-router'
2import { TanStackDevtools } from '@tanstack/react-devtools'
3import { aiDevtoolsPlugin } from '@tanstack/react-ai-devtools'
4import appCss from '../styles.css?url'
5​
6export const Route = createRootRoute({
7 head: () => ({
8 meta: [
9 {
10 charSet: 'utf-8',
11 },
12 {
13 name: 'viewport',
14 content: 'width=device-width, initial-scale=1',
15 },
16 {
17 title: 'Blog desk',
18 },
19 ],
20 links: [
21 {
22 rel: 'stylesheet',
23 href: appCss,
24 },
25 ],
26 }),
27​
28 shellComponent: RootDocument,
29})
30​
31function RootDocument({ children }: { children: React.ReactNode }) {
32 return (
33 <html lang="en">
34 <head>
35 <HeadContent />
36 </head>
37 <body className="min-h-screen bg-gray-900">
38 {children}
39 <TanStackDevtools
40 config={{ position: 'bottom-right' }}
41 plugins={[aiDevtoolsPlugin()]}
42 />
43 <Scripts />
44 </body>
45 </html>
46 )