Guest User

Untitled

a guest
Aug 14th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. render() {
  2. return (
  3. <button type="button" {this.state.submitting ? 'disabled' : ''}
  4. onClick={ this.handleSubmit }>Submit</button>
  5. );
  6. }
  7.  
  8. <button type="button" disabled={this.state.submitting} onClick={ this.handleSubmit }>Submit</button>
  9.  
  10. <button type='button' disabled={this.state.submitting ? 'disabled' : null} onClick={this.handleSubmit}>Submit</button>
  11.  
  12. const disableBtnProps = {};
  13. if (index !== 0) {
  14. disableBtnProps.disabled = false;
  15. } else {
  16. disableBtnProps.disabled = true;
  17. }
  18.  
  19. <Button {...disableBtnProps} className="btn"> my button </Button>
Add Comment
Please, Sign In to add comment