From 1952705dedd53041c1bcd39a3a04059ed5236ed6 Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Thu, 16 Nov 2023 15:42:37 -0800 Subject: [PATCH] Disable refetchOnWindowFocus on react-query (#1936) --- src/lib/react-query.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/lib/react-query.ts b/src/lib/react-query.ts index 2a8f1d75..6b425d3b 100644 --- a/src/lib/react-query.ts +++ b/src/lib/react-query.ts @@ -1,3 +1,13 @@ import {QueryClient} from '@tanstack/react-query' -export const queryClient = new QueryClient() +export const queryClient = new QueryClient({ + defaultOptions: { + queries: { + // NOTE + // refetchOnWindowFocus breaks some UIs (like feeds) + // so we NEVER want to enable this + // -prf + refetchOnWindowFocus: false, + }, + }, +})