How to disable background refetching globally
Hi, we are doing a frontend application which doesnt require polling for new data in the background, how can we disable this setting for the entire application as a default(if we have dynamic data we would surely enable background refresh for certain queries)
2 Replies
yappiest-sapphire•3y ago
react-query doesn't "poll", it triggers refetches on specific heuristics, like window focus events or component mounts.
this only happens for stale queries, so your best bet would be to set
staleTime: Infinity on the default settingsambitious-aquaOP•3y ago
thanks