When does React Query fetch data?
9 May 2025 (Updated 18 May 2025)
- When the component mounts (and the data is stale).
- When the query key changes.
- When the user refocuses on the tab (can turn this off via the
refetchOnWindow
focus option) - When the network is reconnected (can turn off this behaviour via the
refetchOnReconnect
option). - If you set the
refetchInterval
option.
Tagged:
React Query