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' }
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 ],
24}
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'