Skip to content

Commit

Permalink
#555 - queryClient staleTime - don't refetch on client immediately
Browse files Browse the repository at this point in the history
  • Loading branch information
rtrembecky committed Dec 24, 2024
1 parent 36f9c6c commit 8f3035d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ const ReactQueryProvider: FC<PropsWithChildren> = ({children}) => {
if (failureCount >= 3) return false
return true
},
// https://tanstack.com/query/latest/docs/framework/react/guides/ssr#initial-setup
// With SSR, we usually want to set some default staleTime
// above 0 to avoid refetching immediately on the client
staleTime: 60 * 1000,
},
mutations: {
// globalny error handler requestov cez useMutation
Expand Down

0 comments on commit 8f3035d

Please sign in to comment.