Skip to content
Discussion options

You must be logged in to vote

Hmm, the docs explicitly mention that this should work:

https://github.com/tannerlinsley/react-query/blob/25a776d98dfbd629b301abce4dc9b76e5409c881/src/core/types.ts#L72-L77

So maybe it is a bug. Could you create a reproducible codesandbox that shows that behaviour?

As an alternative, instead of triggering refetch manually, you could keep a state boolean variable and pass that to enabled. Then, when you want to trigger the refetch, just set the boolean to true, which will trigger a re-render and the query will then be enabled and fetch normally. This is how I've been handling queries that should be disabled until some action is taken.

But I would still be interested if you can reproduce th…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@TkDodo
Comment options

@gdelacruzfdez
Comment options

Answer selected by gdelacruzfdez
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants