title: How to toggle boolean state of a React component?
body: <p>I'd like to know how to toggle a boolean state of a React component. For instance:</p>
  <p>I have a boolean state check in the constructor of my component:</p>
  <pre><code>constructor(props, context) { 
     super(props, context);
  
     this.state = {
        check: false
     };
  };
  </code></pre>
  <p>I am trying to toggle the state each time my checkbox is clicked, using the <code>this.setState</code> method:</p>
  <pre><code>&lt;label&gt;
    &lt;input
      type=checkbox&quot;
      value=&quot;check&quot;
      onChange={(e) =&gt; this.setState({check: !check.value})}
    /&gt;
    Checkbox
  &lt;/label&gt;
  </code></pre>
  <p>Of course I get a <em>Uncaught ReferenceError: check is not defined</em>.
  So how can I achieve this?</p>