-
I have a I found a way to stop this fetch by using the
But I am wondering if there is a better way to achieve this. Thank you in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
given that you are using
that seems a bit weird to me. Once you have data in the cache, we don't remove it. Maybe the query transitions to an |
Beta Was this translation helpful? Give feedback.
given that you are using
networkMode
, I assume you are onv4
. The default networkMode of'online'
should do what you want here. It expects you to beonline
to trigger a query, and if not, the query will go into paused state while still giving you data from the cache.that seems a bit weird to me. Once you have data in the cache, we don't remove it. Maybe the query transitions to an
error
state andpersistQueryClient
doesn't include erroneous queries, as per default only successful queries are included:https://github.com/tannerlinsley/react-query/blob/19…