execute useMutation inside of onSuccess #6831
Unanswered
ramunecroft
asked this question in
Q&A
Replies: 1 comment
-
you cannot call a hook in a callback - that's not how react works. You must call the hook at the top level, then invoke |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I want to use react-query so that when Request A succeeds at the onMount stage, it calls B, and if B succeeds, it calls C. However, in this case, should I mix raw fetch without react-query and react-query instead of using react-query for everything? It seems that useMutation inside onSuccess does not work for some reason.
Beta Was this translation helpful? Give feedback.
All reactions