[portal] disable react query refetch on window focus

This commit is contained in:
Yangshun Tay
2022-10-11 06:44:29 +08:00
parent 6ff3842d5e
commit b5c930ed68

View File

@ -53,13 +53,18 @@ export default withTRPC<AppRouter>({
}), }),
httpBatchLink({ url }), httpBatchLink({ url }),
], ],
/**
* @link https://tanstack.com/query/v4/docs/reference/QueryClient
*/
queryClientConfig: {
defaultOptions: {
queries: {
refetchOnWindowFocus: false,
},
},
},
transformer: superjson, transformer: superjson,
url, url,
/**
* @link https://react-query.tanstack.com/reference/QueryClient
*/
// queryClientConfig: { defaultOptions: { queries: { staleTime: 60 } } },
// To use SSR properly you need to forward the client's headers to the server // To use SSR properly you need to forward the client's headers to the server
// headers: () => { // headers: () => {
// if (ctx?.req) { // if (ctx?.req) {