From 3802be16734212d2b4c380152c820150481175a4 Mon Sep 17 00:00:00 2001 From: Pramod Mahajan Date: Fri, 27 Jun 2025 15:52:29 +0530 Subject: [PATCH] seprated moda querClient obj inside AuthLayout ,because we can reuse queryClient --- src/App.tsx | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 3fbc0cee..be7a72ba 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,19 +1,11 @@ import { DireProvider } from "./Context/DireContext"; import AppRoutes from "./router/AppRoutes"; import { ToastContainer } from "react-toastify"; -import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; +import { QueryClientProvider } from '@tanstack/react-query'; import { ReactQueryDevtools } from '@tanstack/react-query-devtools'; +import { queryClient } from "./layouts/AuthLayout"; + -const queryClient = new QueryClient({ - defaultOptions: { - queries: { - staleTime: 5 * 60 * 1000, // 5 min: data considered fresh - refetchOnWindowFocus: false, // refresh on tab switch - refetchOnReconnect: true, // re-fetch if network was lost - retry: false, - }, - }, -}); const App = () => { return (