Skip to content
Discussion options

You must be logged in to vote

Before you would have had to at least import the built-in query cache from react-query, so you should really just be swapping that import with a different import. And yes, that's the intended usage: If you are in react-land, useQueryClient, and if you are in a hoisted non-react scope, just import queryClient from './myQueryClient'.

Also, a pattern that I use often is to essentially have a custom hook for every crud operation I can do. That's where I compose everything together.

Replies: 1 comment 2 replies

Comment options

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

@changyeamoon
Comment options

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