T
TanStack3y ago
graceful-beige

Queries run non-stop

Been troubleshooting this for hours and can't figure it out. If the query key is just a single string in an array, completely stable, shouldn't it be impossible for the query to execute again before the cache goes stale? Which I believe is 5 minutes? Trying to understand what other reasons there could be that useQuery would keep executing in an infinite loop. Any help is appreciated.
1 Reply
compatible-crimson
compatible-crimson3y ago
You're mixing up cacheTime and staleTime. staleTime is 0 and that defines how often requests can happen. For an infinite loop, I'd need to see a reproduction please

Did you find this page helpful?