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
Consider a button that sets disabled={this.state.hasSent} and onClick={this.state.hasSent ? null : this.sendMoney}. If sendMoney sets hasSent to true, the product developer expectation is that onClick will not fire again. Otherwise two fast clicks can send the money twice, and that is a very error-prone conceptual model.
In this example, you've set both the disabled attribute and checked that flag in the onClick handler. Does this mean that it's not sufficient to only set the disabled attribute and that you also need to check inside the click handler to prevent these kinds of click more than once issues?
In this example, you've set both the disabled attribute and checked that flag in the onClick handler. Does this mean that it's not sufficient to only set the disabled attribute and that you also need to check inside the click handler to prevent these kinds of click more than once issues?
Originally posted by @johnywith1n in facebook/react#11171 (comment)
The text was updated successfully, but these errors were encountered: