I'm using react-query v3.13
to fetch data from API.
What I want to do is to fetch API regularly from a certain point (for example, when clicking the start button), not from the time of calling useQuery.
I tried the following ways.
- set
enabled
property tofalse
to disable automatic querying but it also disables re-fetching.
I could not find a way to re-enable/set theenabled
property totrue
. And I had to usesetTimeout
by myself to re-fetch regularly. - keep
enabled
property astrue
but I could not find a way to disable the initial fetching.
Is there any proper way to do this?
forceFetchOnMount
property in the previous version, but it's replaced byrefetchOnMount
in version 3. – Petard