In my project, I have a button which I want to disable using state.
<Button
color='success'
onClick={this.changeForm}
block
disabled
>
LOGIN
</Button>
I am using Reactstrap. I have a flag value set in the state. I want to disable the button if flag is set to TRUE. So, I came up with this code:
<Button
color='success'
onClick={this.changeForm}
block
{this.state.flag && 'disabled'}
>
LOGIN
</Button>
I am getting Syntax Error. I understand that that's a not proper syntax so how can I achieve the functionality that I want?