Skip to content

Context for the enabled: false behaviour #2553

Answered by TkDodo
mrlubos asked this question in Q&A
Discussion options

You must be logged in to vote

enabled is an option that works on the observer level - so it can be different for each useQuery instance. It just says that when used in this component, it will not trigger any data fetching. Of course, if data gets into the cache by any other means, e.g. because you fetch it manually, or because you call setQueryData for example, you will still get data even if the observer is disabled, because data in the cache will always be delivered to consumers.

Tbh, I've never seen a use-case where you'd enabled one and disable another observer of the same query. At least not on the same page, mounted at the same time. Maybe there is one, not really sure. By using custom hooks, you likely won't ge…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mrlubos
Comment options

Answer selected by mrlubos
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