-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path__root.tsx
33 lines (27 loc) · 842 Bytes
/
__root.tsx
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
import { Outlet, createRootRouteWithContext } from "@tanstack/react-router";
import { Fragment } from "react";
import { TanStackRouterDevelopmentTools } from "../components/developmentTools";
import { useDocTitle } from "../components/hooks";
import { QueryClient } from "@tanstack/react-query";
import { TAuthStoreState } from "../store";
type TRouterContext = {
auth: TAuthStoreState | null;
queryClient: QueryClient;
};
export const Route = createRootRouteWithContext<TRouterContext>()({
component: RootComponent,
notFoundComponent: () => <div>Not Found</div>,
errorComponent: () => <div>Error</div>,
});
function RootComponent() {
useDocTitle();
return (
<Fragment>
<Outlet />
<TanStackRouterDevelopmentTools
position="bottom-left"
initialIsOpen={false}
/>
</Fragment>
);
}