Skip to content

Commit 096da93

Browse files
committed
docs: migration guide for window focus changes
1 parent 324e69c commit 096da93

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

docs/react/guides/migrating-to-v5.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,10 @@ useQuery<number, string>({
162162

163163
Since the only supported syntax now is the object syntax, this rule is no longer needed
164164

165+
### Window focus refetching no longer listens to the `focus` event
166+
167+
The `visibilitychange` event is used exclusively now. This is possible because we only support browsers that support the `visibilitychange` event. This fixes a bunch of issues [as listed here](https://github.com/TanStack/query/pull/4805).
168+
165169
### No longer using `unstable_batchedUpdates` as the batching function in React and React Native
166170

167171
Since the function `unstable_batchedUpdates` is noop in React 18, it will no longer be automatically set as the batching function in `react-query`.
@@ -171,8 +175,8 @@ If your framework supports a custom batching function, you can let TanStack Quer
171175
For example, this is how the batch function is set in `solid-query`:
172176

173177
```ts
174-
import { notifyManager } from '@tanstack/query-core'
175-
import { batch } from 'solid-js'
176-
177-
notifyManager.setBatchNotifyFunction(batch)
178+
import { notifyManager } from '@tanstack/query-core'
179+
import { batch } from 'solid-js'
180+
181+
notifyManager.setBatchNotifyFunction(batch)
178182
```

0 commit comments

Comments
 (0)