Grokking React Native
0% completed
Offline Support and Caching
The React Query cache lives in memory, so it can show earlier results while the app runs, even when the network is unavailable. What the user sees during that time depends on three separate decisions: how long results stay useful, how React Query learns about the network, and what your screen checks before it renders.
How Long Results Stay: staleTime and gcTime
Two timers control every cached result, and they measure different things. The staleTime setting says how long a result counts as fresh. While it is fresh, a component that appears uses it and sends no request. The `gcTime
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%