Skip to content

Commit

Permalink
docs: add pitfalls section for window focus refetching (#3018)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dynalon authored Nov 24, 2021
1 parent 9114774 commit f18881d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/src/pages/guides/window-focus-refetching.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,7 @@ focusManager.setFocused(true)
// Fallback to the default focus check
focusManager.setFocused(undefined)
```

## Pitfalls & Caveats

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.

1 comment on commit f18881d

@vercel
Copy link

@vercel vercel bot commented on f18881d Nov 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.