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

__root.tsx

38 lines902 Bytes

1/// <reference types="vite/client" />
2import {
3 HeadContent,
4 Link,
5 Scripts,
6 createRootRoute,
7} from '@tanstack/solid-router'
8import { HydrationScript } from 'solid-js/web'
9import { TanStackRouterDevtools } from '@tanstack/solid-router-devtools'
10import type * as Solid from 'solid-js'
11import appCss from '~/styles/app.css?url'
12​
13export const Route = createRootRoute({
14 head: () => ({
15 links: [{ rel: 'stylesheet', href: appCss }],
16 }),
17 shellComponent: RootDocument,
18})
19​
20function RootDocument(props: { children: Solid.JSX.Element }) {
21 return (
22 <html>
23 <head>
24 <HydrationScript />
25 </head>
26 <body>
27 <HeadContent />
28 <div>
29 <Link to="/">Index</Link>
30 <Link to="/about">About</Link>
31 </div>
32 {props.children}
33 <TanStackRouterDevtools position="bottom-right" />
34 <Scripts />
35 </body>
36 </html>
37 )