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
refetchOnWindowfocus option) - When the network is reconnected (can turn off this behaviour via the
refetchOnReconnectoption). - If you set the
refetchIntervaloption.
Tagged:
React Query