React Query Integration for Server State Sync in Clinet #245
@ -1,5 +1,17 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import { Outlet } from "react-router-dom";
|
import {Outlet} from "react-router-dom";
|
||||||
|
import {QueryClient} from '@tanstack/react-query';
|
||||||
|
|
||||||
|
export const queryClient = new QueryClient({
|
||||||
|
defaultOptions: {
|
||||||
|
queries: {
|
||||||
|
staleTime: 5 * 60 * 1000, // 5 min: data considered fresh
|
||||||
|
refetchOnWindowFocus: false, // refresh on tab switch
|
||||||
|
refetchOnReconnect: false, // re-fetch if network was lost
|
||||||
|
retry: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
const AuthLayout = () => {
|
const AuthLayout = () => {
|
||||||
return (
|
return (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user