Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- render() {
- return (
- <button type="button" {this.state.submitting ? 'disabled' : ''}
- onClick={ this.handleSubmit }>Submit</button>
- );
- }
- <button type="button" disabled={this.state.submitting} onClick={ this.handleSubmit }>Submit</button>
- <button type='button' disabled={this.state.submitting ? 'disabled' : null} onClick={this.handleSubmit}>Submit</button>
- const disableBtnProps = {};
- if (index !== 0) {
- disableBtnProps.disabled = false;
- } else {
- disableBtnProps.disabled = true;
- }
- <Button {...disableBtnProps} className="btn"> my button </Button>
Add Comment
Please, Sign In to add comment