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

__root.tsx

64 lines1.5 KB

1import { HeadContent, Scripts, createRootRoute } from '@tanstack/solid-router'
2import { TanStackRouterDevtoolsPanel } from '@tanstack/solid-router-devtools'
3import { TanStackDevtools } from '@tanstack/solid-devtools'
4// import { aiDevtoolsPlugin } from "@tanstack/react-ai-devtools";
5import { HydrationScript } from 'solid-js/web'
6import appCss from '../styles.css?url'
7import Header from '../components/Header'
8import type { JSXElement } from 'solid-js'
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 Start Starter',
22 },
23 ],
24 links: [
25 {
26 rel: 'stylesheet',
27 href: appCss,
28 },
29 ],
30 }),
31​
32 shellComponent: RootDocument,
33})
34​
35function RootDocument({ children }: { children: JSXElement }) {
36 return (
37 <html lang="en">
38 <head>
39 <HydrationScript />
40 </head>
41 <body>
42 <HeadContent />
43 <Header />
44 {children}
45 <TanStackDevtools
46 config={{
47 position: 'bottom-right',
48 }}
49 plugins={[
50 {
51 name: 'Tanstack Router',
52 render: <TanStackRouterDevtoolsPanel />,
53 },
54 // aiDevtoolsPlugin(),
55 ]}
56 eventBusConfig={{
57 connectToServerBus: true,
58 }}
59 />
60 <Scripts />
61 </body>
62 </html>
63 )