You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem with Example 2 is that it does not disable the button immediately after clicking it, but waits until RPC calls up the contract. So when my RPC node is slow, the user will click the button multiple times, resulting in this situation:
(evoke wallet multiple times)
I don't want to add a new useState to implement it, it would be too troublesome.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Goal: When I click the button to trigger
writeContract
, disable this button immediately (please note that it is immediately)Example 1, in wagmi v1 I can do this:
Example 2, but it doesn’t seem to work in wagmi v2:
The problem with Example 2 is that it does not disable the button immediately after clicking it, but waits until RPC calls up the contract. So when my RPC node is slow, the user will click the button multiple times, resulting in this situation:
(evoke wallet multiple times)
I don't want to add a new
useState
to implement it, it would be too troublesome.How to solve this problem? Thanks!
Beta Was this translation helpful? Give feedback.
All reactions