title: In React how to update multiple check box values in to array ?
body: <p>The form has multiple checkbox a particular question. Is there any option in react to put selected values in to one array like <code>{questionID: 4, answerValues: [1, 3,4]}</code> which update based on <code>onChange</code> </p>
  
  <pre><code>  onChange(event) {
      const question = event.target.dataset.questionId;
      const result = event.target.value;
      let newAnswer = {
        questionID: question,
        answerValues: [result]
      };
  
      console.log(newAnswer);
      //this.props.updateAnswer(newAnswer);
    }
  </code></pre>
  
  <p>Demo: <a href="https://codesandbox.io/s/mm49vkx62p" rel="nofollow noreferrer">https://codesandbox.io/s/mm49vkx62p</a></p>