Call multiple hooks from a single button? #3557
Unanswered
raffle-x-dev
asked this question in
Q&A
Replies: 1 comment
-
You can use useEffect and track isSuccess for approve. After is success inside useEffect you can execute write() |
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
-
I wonder if there's a way (sure there is) to call multiple hooks from a single "onClick="
I need to set an allowance for an erc20 token, send ETH from caller's wallet, and call a mint function once the first two operations are done. What's the best practice to do this? So far I only have separate block of codes for the 3 parts. Need to put them together but I'm struggling a bit, cause wagmi hooks operate only inside components and if I put everything inside one component I have naming problems.
Beta Was this translation helpful? Give feedback.
All reactions