Repository navigation
API being called on page mount every time despite having stale and cache values of 5 minutes #9734
Replies: 1 comment
|
When TanStack Query fires an unexpected network request on mount despite having Here is a breakdown of the root causes and how to resolve them: 1. The
|
Uh oh!
There was an error while loading. Please reload this page.
Hi @ALL, I have been working on a react native expo project and I have cached an api with gcTime of 10 minutes and staleTime of 5 minutes. I am adding the relevant components
//useAgentProfile.tsx
The keys do not change on page mount, stale is false, and data exists in cache. I've verified it using following consoles
Cache for query key: ["agent", "profile", 'a number here']
Cached data: true
Is data stale?: false
Data updated at: 10/6/2025, 6:53:46 PM
what are the common troubleshooting steps or some common beginners mistakes that I might be making.
All reactions