State Management · Junior · Question 43 of 75

Why does TanStack Query refetch data when you return to the browser tab?

Explanation

The default is aggressive freshness: stale data is refetched on mount, window focus and reconnect. If the data rarely changes, raise staleTime globally or per query.

Further reading

Problem with a question

State Management · Junior · question 43

Test yourself

Take the State Management · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz