Open History to see the last commit
1/// <reference types="vite/client" />
2import {
3 HeadContent,
4 Link,
5 Scripts,
6 createRootRouteWithContext,
7} from '@tanstack/solid-router'
8import { TanStackRouterDevtoolsInProd } from '@tanstack/solid-router-devtools'
9import { HydrationScript } from 'solid-js/web'
10import type { QueryClient } from '@tanstack/solid-query'
11import appCss from '~/styles/app.css?url'
12β
13export const Route = createRootRouteWithContext<{
14 queryClient: QueryClient
15}>()({
16 head: () => ({
17 meta: [
18 {
19 charset: 'utf-8',
20 },
21 ],
22 links: [{ rel: 'stylesheet', href: appCss }],
23 }),
24 shellComponent: RootDocument,
25})
26β
27function RootDocument(props: { children?: any }) {
28 return (
29 <html>
30 <head>
31 <HydrationScript />
32 </head>
33 <body>
34 <HeadContent />
35 <div class="p-2 flex gap-2 text-lg">
36 <Link
37 to="/"
38 activeProps={{
39 class: 'font-bold',
40 }}
41 >
42 Home
43 </Link>{' '}
44 <Link
45 to="/loader-fetchQuery/$type"
46 params={{ type: 'sync' }}
47 activeProps={{
48 class: 'font-bold',
49 }}
50 >
51 fetchQuery (sync)
52 </Link>{' '}
53 <Link
54 to="/loader-fetchQuery/$type"
55 params={{ type: 'async' }}
56 activeProps={{
57 class: 'font-bold',
58 }}
59 >
60 fetchQuery (async)
61 </Link>{' '}
62 <Link
63 to="/useQuery"
64 activeProps={{
65 class: 'font-bold',
66 }}
67 >
68 useQuery
69 </Link>{' '}
70 {/* <Link
71 to="/useSuspenseQuery"
72 activeProps={{
73 class: 'font-bold',
74 }}
75 >
76 useSuspenseQuery
77 </Link>{' '} */}
78 </div>
79 <hr />
80 {props.children}
81 <TanStackRouterDevtoolsInProd position="bottom-right" />
82 <Scripts />
83 </body>
84 </html>
85 )
86}