title: How to return true or false using the input checkbox in react js?
body: <p>My input checkbox always returns true, when i mark it passsa true correctly, but when i unmark tb i get true. I would like the checkbox to return true when checked and false when unchecked, this way I would apply my logic in the handlesubmit function.</p>
  
  <pre><code>
      handleChange = e =&gt; {
          const { name, value } = e.target;
          console.log(name, value);
          switch (name) {
  
            case 'period': this.json.schedule = 'period'; break;
  
      }
  
  
   &lt;input
         type="checkbox"
         name="period"
         defaultValue
         onChange={this.handleChange}
   /&gt;
  
  </code></pre>