__root.tsx 1012 B

123456789101112131415161718192021222324252627282930
  1. import { QueryClient } from '@tanstack/react-query'
  2. import { createRootRouteWithContext, Outlet } from '@tanstack/react-router'
  3. import { ReactQueryDevtools } from '@tanstack/react-query-devtools'
  4. import { TanStackRouterDevtools } from '@tanstack/router-devtools'
  5. import { Toaster } from '@/components/ui/toaster'
  6. import { NavigationProgress } from '@/components/navigation-progress'
  7. import GeneralError from '@/features/errors/general-error'
  8. import NotFoundError from '@/features/errors/not-found-error'
  9. export const Route = createRootRouteWithContext<{
  10. queryClient: QueryClient
  11. }>()({
  12. component: () => {
  13. return (
  14. <>
  15. <NavigationProgress />
  16. <Outlet />
  17. <Toaster />
  18. {import.meta.env.MODE === 'development' && (
  19. <>
  20. <ReactQueryDevtools buttonPosition='bottom-left' />
  21. <TanStackRouterDevtools position='bottom-right' />
  22. </>
  23. )}
  24. </>
  25. )
  26. },
  27. notFoundComponent: NotFoundError,
  28. errorComponent: GeneralError,
  29. })