Skip to content

Commit f18881d

Browse files
authored
docs: add pitfalls section for window focus refetching (TanStack#3018)
1 parent 9114774 commit f18881d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

docs/src/pages/guides/window-focus-refetching.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,7 @@ focusManager.setFocused(true)
8787
// Fallback to the default focus check
8888
focusManager.setFocused(undefined)
8989
```
90+
91+
## Pitfalls & Caveats
92+
93+
Some browser internal dialogue windows, such as spawned by `alert()` or file upload dialogues (as created by `<input type="file" />`) might also trigger focus refetching after they close. This can result in unwanted side effects, as the refetching might trigger component unmounts or remounts before your file upload handler is executed. See [this issue on GitHub](https://github.com/tannerlinsley/react-query/issues/2960) for background and possible workarounds.

0 commit comments

Comments
 (0)