2024-03-20 18:00:23 +00:00
|
|
|
import { createRootRouteWithContext, Outlet } from '@tanstack/react-router';
|
2024-04-08 17:01:33 +00:00
|
|
|
// import { TanStackRouterDevtools } from '@tanstack/router-devtools';
|
2024-04-01 17:12:44 +00:00
|
|
|
import { Suspense } from 'react';
|
2024-03-20 18:00:23 +00:00
|
|
|
|
|
|
|
interface RouterContext {
|
|
|
|
// The ReturnType of your useAuth hook or the value of your AuthContext
|
|
|
|
userInfo: any;
|
|
|
|
}
|
|
|
|
|
|
|
|
export const Route = createRootRouteWithContext<RouterContext>()({
|
|
|
|
component: () => {
|
|
|
|
return (
|
2024-04-01 17:12:44 +00:00
|
|
|
// https://github.com/TanStack/router/issues/857
|
|
|
|
<Suspense fallback={null}>
|
2024-03-20 18:00:23 +00:00
|
|
|
<Outlet />
|
2024-04-08 17:01:33 +00:00
|
|
|
|
|
|
|
{/* <TanStackRouterDevtools position="bottom-right" /> */}
|
2024-04-01 17:12:44 +00:00
|
|
|
</Suspense>
|
2024-03-20 18:00:23 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
});
|