-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Expand file tree
/
Copy path__root.tsx
More file actions
40 lines (36 loc) · 812 Bytes
/
__root.tsx
File metadata and controls
40 lines (36 loc) · 812 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/// <reference types="vite/client" />
import {
HeadContent,
Outlet,
Scripts,
createRootRouteWithContext,
} from '@tanstack/react-router'
import type { QueryClient } from '@tanstack/react-query'
import type { ReactNode } from 'react'
export const Route = createRootRouteWithContext<{
queryClient: QueryClient
}>()({
component: RootComponent,
})
function RootComponent() {
return (
<RootDocument>
<Outlet />
</RootDocument>
)
}
function RootDocument({ children }: Readonly<{ children: ReactNode }>) {
return (
<html lang="en">
<head>
<meta charSet="utf-8" />
<meta content="width=device-width, initial-scale=1" name="viewport" />
<HeadContent />
</head>
<body>
{children}
<Scripts />
</body>
</html>
)
}