-
Notifications
You must be signed in to change notification settings - Fork 453
Expand file tree
/
Copy path__root.tsx
More file actions
46 lines (43 loc) · 1.13 KB
/
__root.tsx
File metadata and controls
46 lines (43 loc) · 1.13 KB
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
41
42
43
44
45
46
/// <reference types="vite/client" />
import * as React from 'react';
import { TanStackRouterDevtools } from '@tanstack/react-router-devtools';
import { ClerkProvider } from '@clerk/tanstack-react-start';
import { HeadContent, Outlet, Scripts, createRootRoute } from '@tanstack/react-router';
import appCss from '~/styles/app.css?url';
export const Route = createRootRoute({
head: () => ({
links: [{ rel: 'stylesheet', href: appCss }],
}),
component: RootComponent,
});
function RootComponent() {
return (
<RootDocument>
<Outlet />
</RootDocument>
);
}
function RootDocument({ children }: { children: React.ReactNode }) {
return (
<html>
<head>
<HeadContent />
</head>
<body>
<ClerkProvider
clerkJSUrl={import.meta.env.VITE_CLERK_JS_URL}
clerkUIUrl={import.meta.env.VITE_CLERK_UI_URL}
appearance={{
options: {
showOptionalFields: true,
},
}}
>
{children}
</ClerkProvider>
<TanStackRouterDevtools position='bottom-right' />
<Scripts />
</body>
</html>
);
}