-
The docs (in the source code) say: /**
* If set to `true`, the query will refetch on window focus if the data is stale.
* If set to `false`, the query will not refetch on window focus.
* If set to `'always'`, the query will always refetch on window focus.
* If set to a function, the function will be executed with the latest data and query to compute the value.
* Defaults to `true`.
*/ However, when this is set to queryClient.setDefaultOptions({
queries: {
placeholderData: (prevData: unknown) => prevData,
refetchOnWindowFocus: import.meta.env.PROD,
},
mutations: {
retry: 1,
},
}); |
Beta Was this translation helpful? Give feedback.
Answered by
TkDodo
Mar 13, 2025
Replies: 1 comment
-
This is correct. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
ffxsam
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is correct.
staleTime
defaults to zero, so yeah, all queries are immediately stale.