Disable refetchOnWindowFocus on react-query (#1936)

zio/stable
Paul Frazee 2023-11-16 15:42:37 -08:00 committed by GitHub
parent 6dfb2a232f
commit 1952705ded
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 1 deletions

View File

@ -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,
},
},
})