Skip to content
Source
Sign inSign up
TanStack/query
Open History to see the last commit

window-focus-refetching.md

40 lines726 Bytes

1---
2id: window-focus-refetching
3title: Window Focus Refetching
4ref: docs/framework/react/guides/window-focus-refetching.md
5replace: { '@tanstack/react-query': '@tanstack/angular-query' }
6---
7​
8[//]: # 'Example'
9​
10```ts
11export const appConfig: ApplicationConfig = {
12 providers: [
13 provideTanStackQuery(
14 () =>
15 new QueryClient({
16 defaultOptions: {
17 queries: {
18 refetchOnWindowFocus: false, // default: true
19 },
20 },
21 }),
22 ),
23 ],
25```
26​
27[//]: # 'Example'
28[//]: # 'Example2'
29​
30```ts
31injectQuery(() => ({
32 queryKey: ['todos'],
33 queryFn: fetchTodos,
34 refetchOnWindowFocus: false,
35}))
36```
37​
38[//]: # 'Example2'
39[//]: # 'ReactNative'
40[//]: # 'ReactNative'