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

window-focus-refetching.md

39 lines713 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-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 ],
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'