Open History to see the last commit
1/// <reference types="vite/client" />
2import {
3 HeadContent,
4 Link,
5 Scripts,
6 createRootRoute,
7} from '@tanstack/react-router'
8import { TanStackRouterDevtools } from '@tanstack/react-router-devtools'
9import * as React from 'react'
10import { DefaultCatchBoundary } from '~/components/DefaultCatchBoundary'
11import { NotFound } from '~/components/NotFound'
12import appCss from '~/styles/app.css?url'
13import { seo } from '~/utils/seo'
14β
15export const Route = createRootRoute({
16 head: () => ({
17 meta: [
18 {
19 charSet: 'utf-8',
20 },
21 {
22 name: 'viewport',
23 content: 'width=device-width, initial-scale=1',
24 },
25 ...seo({
26 title:
27 'TanStack Start | Type-Safe, Client-First, Full-Stack React Framework',
28 description: `TanStack Start is a type-safe, client-first, full-stack React framework. `,
29 }),
30 ],
31 links: [
32 { rel: 'stylesheet', href: appCss },
33 {
34 rel: 'apple-touch-icon',
35 sizes: '180x180',
36 href: '/apple-touch-icon.png',
37 },
38 {
39 rel: 'icon',
40 type: 'image/png',
41 sizes: '32x32',
42 href: '/favicon-32x32.png',
43 },
44 {
45 rel: 'icon',
46 type: 'image/png',
47 sizes: '16x16',
48 href: '/favicon-16x16.png',
49 },
50 { rel: 'manifest', href: '/site.webmanifest', color: '#fffff' },
51 { rel: 'icon', href: '/favicon.ico' },
52 ],
53 }),
54 errorComponent: DefaultCatchBoundary,
55 notFoundComponent: () => <NotFound />,
56 shellComponent: RootDocument,
57})
58β
59function RootDocument({ children }: { children: React.ReactNode }) {
60 return (
61 <html>
62 <head>
63 <HeadContent />
64 </head>
65 <body>
66 <div className="p-2 flex gap-2 text-lg">
67 <Link
68 to="/"
69 activeProps={{
70 className: 'font-bold',
71 }}
72 activeOptions={{ exact: true }}
73 >
74 Home
75 </Link>
76 </div>
77 <hr />
78 {children}
79 <TanStackRouterDevtools position="bottom-right" />
80 <Scripts />
81 </body>
82 </html>
83 )
84}