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

__root.tsx

61 lines1.2 KB

1import { HeadContent, Scripts, createRootRoute } from '@tanstack/react-router'
2import appCss from '../styles.css?url'
3​
4const NotFound = () => {
5 return (
6 <div>
7 <h1>404 - Page Not Found</h1>
8 </div>
9 )
11​
12export const Route = createRootRoute({
13 head: () => ({
14 meta: [
15 {
16 charSet: 'utf-8',
17 },
18 {
19 name: 'viewport',
20 content: 'width=device-width, initial-scale=1',
21 },
22 {
23 title: 'Code Mode Demo - GitHub + NPM Analytics',
24 },
25 ],
26 links: [
27 {
28 rel: 'stylesheet',
29 href: appCss,
30 },
31 {
32 rel: 'icon',
33 type: 'image/svg+xml',
34 href: 'https://tanstack.com/favicon-light.svg',
35 media: '(prefers-color-scheme: light)',
36 },
37 {
38 rel: 'icon',
39 type: 'image/svg+xml',
40 href: 'https://tanstack.com/favicon-dark.svg',
41 media: '(prefers-color-scheme: dark)',
42 },
43 ],
44 }),
45 notFoundComponent: NotFound,
46 shellComponent: RootDocument,
47})
48​
49function RootDocument({ children }: { children: React.ReactNode }) {
50 return (
51 <html lang="en">
52 <head>
53 <HeadContent />
54 </head>
55 <body className="bg-gray-100">
56 {children}
57 <Scripts />
58 </body>
59 </html>
60 )