title: Changing the state of a checkbox with setState
body: <p>I have a component and i am able to change the state of checkbox item when i click on a button.
  I also want to be able to change the state in another button-click, which has lot more logic in it. 
  The issue i am having in that when the code goes into the condition it does not set the state back to false. </p>
  
  <p>I tried changing the state again using setstate but it does not change the state of the enabledCheckBox.</p>
  
  <pre><code>this.setState({
    enabledCheckBox: !this.state.enabledCheckBox,
  })
  </code></pre>
  
  <p>Can anyone tell me what the issue is?
  Thanks</p>
  
  <pre><code>class Customer extends Component {
    constructor(props) {
      super(props)
      this.state = {
        ...props,
        enabledCheckBox: false
      };
    }
  
    //this works    
    onChangeCheckBox=()=&gt;{
      this.setState({
        enabledCheckBox: !this.state.enabledCheckBox,
      })
    }
  
    //cant get this to work
    handleCustomerClick = (event) =&gt; {
  
      if (this.state.enabledCheckBox) {      
        this.setState({
          enabledCheckBox: !this.state.enabledCheckBox,
        })
      }
  </code></pre>