Skip to content
Discussion options

You must be logged in to vote

since you have to have a QueryCientProvider at the top of your react tree with v3, useQueryClient will give you that cache. The direct import is only recommended for when you can't use the hook. So unless you need that, I wouldn't even export the client and always retrieve it via the hook. This will make testing easier because you can just wrap your tests with a different Provider and it will just work™️

Replies: 1 comment 1 reply

Comment options

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

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