Skip to content

Commit

Permalink
Disable refetch on window focus
Browse files Browse the repository at this point in the history
  • Loading branch information
clementprdhomme committed Oct 15, 2024
1 parent 537da84 commit 9d468eb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion frontend/src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ type Props = AppProps & {
const App: React.FC<AppProps> = ({ Component, pageProps }: Props) => {
// Never ever instantiate the client outside a component, hook or callback as it can leak data
// between users
const [queryClient] = useState(() => new QueryClient());
const [queryClient] = useState(
() => new QueryClient({ defaultOptions: { queries: { refetchOnWindowFocus: false } } })
);

const router = useRouter();

Expand Down

0 comments on commit 9d468eb

Please sign in to comment.