[portal] disable react query refetch on window focus

pull/356/head
Yangshun Tay 2 years ago
parent 6ff3842d5e
commit b5c930ed68

@ -53,13 +53,18 @@ export default withTRPC<AppRouter>({
}), }),
httpBatchLink({ url }), httpBatchLink({ url }),
], ],
transformer: superjson,
url,
/** /**
* @link https://react-query.tanstack.com/reference/QueryClient * @link https://tanstack.com/query/v4/docs/reference/QueryClient
*/ */
// queryClientConfig: { defaultOptions: { queries: { staleTime: 60 } } }, queryClientConfig: {
defaultOptions: {
queries: {
refetchOnWindowFocus: false,
},
},
},
transformer: superjson,
url,
// 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) {

Loading…
Cancel
Save