title: How to pass checkbox state to onClick Function in React
body: <p>I am currently a bit lost with this - as I thought - trivial task. I have some checkboxes in my React App which have a onClick Function. Now I need to pass the info to the function, if I just checked or unchecked the checkbox. </p>
  
  <pre><code>&lt;input type="checkbox"
         name={field}
         id={field}
         onClick={() =&gt; this.buildTemplate(objectA, objectB, checkboxState)}
  /&gt;
  &lt;label htmlFor={field}&gt;
      {getLabel(`${this.props.modelType}.${fieldName}`)} 
  &lt;/label&gt;
  </code></pre>
  
  <p>When the function is called, I need to do some stuff depending on the state of the checkbox.</p>
  
  <pre><code>buildTemplate = (objectA, objectB, checked) =&gt; {
      checked ? yep() : nope();
  };
  </code></pre>
  
  <p>I tried to bind the checkbox like this, and it worked, but now I dont know how to pass the other arguments in this function.</p>
  
  <pre><code>onClick={this.testFunc.bind(this)}
  
  ...
  
  testFunc(event) {
      console.log(event.target.checked)
  }
  </code></pre>
  
  <p>I also found <a href="https://stackoverflow.com/questions/36833192/get-the-value-of-checkbox-using-ref-in-react?utm_medium=organic&amp;utm_source=google_rich_qa&amp;utm_campaign=google_rich_qa">this question</a>, where the accepted answer suggested refs, but I may have a lot of checkboxes, and it seems a bit overkill to me, to create refs just to pass the current state of the checkbox. 
  I think there is a dumb solution for this, but it seems like I can't figure it out.</p>