Open History to see the last commit
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-experimental' }
6---
7β
8[//]: # 'Example'
9β
10```ts
11export const appConfig: ApplicationConfig = {
12 providers: [
13 provideTanStackQuery(
14 new QueryClient({
15 defaultOptions: {
16 queries: {
17 refetchOnWindowFocus: false, // default: true
18 },
19 },
20 }),
21 ),
22 ],
23}
24```
25β
26[//]: # 'Example'
27[//]: # 'Example2'
28β
29```ts
30injectQuery(() => ({
31 queryKey: ['todos'],
32 queryFn: fetchTodos,
33 refetchOnWindowFocus: false,
34}))
35```
36β
37[//]: # 'Example2'
38[//]: # 'ReactNative'
39[//]: # 'ReactNative'