Unnecessary API'S call

I am facing a issue regarding unneccessary api calls when i switch to another tab and return to my local tab the same api's call hit again and again i am using tRPC first time
3 Replies
Neto
Neto3mo ago
the issue isnt trpc is react query
Neto
Neto3mo ago
Window Focus Refetching | TanStack Query Docs
If a user leaves your application and returns and the query data is stale, TanStack Query automatically requests fresh data for you in the background. You can disable this globally or per-query using the refetchOnWindowFocus option: Disabling Globally
ajay
ajay3mo ago
Thanks for help issue is now resolve