Skip to content

React Query with class is working, but I don't know how it's possible. #8851

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

You must be logged in to vote

you are violating the rules-of-hooks, but it will work as long as the class is only called within a React component, and if its not called conditionally. Try creating a new AuthMutation() in a button click handler and you will see it fail.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ayden94
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