title: ReactJs multiples checkbox using Material
body: <p>I have a problem retrieving the values selected in the checkbox
  I have a list with several names but when I select a name in the checkbox it is selected. However, when trying to select a different name, the value retrieved is always the same as the first selection.</p>
  <pre><code>const onNameChange = (event)=&gt;{
          let value = state.name.split(&quot;;&quot;);
          if(value.includes(event.target.value)){
              let index = value.indexOf(event.target.value);
              value.splice(index, 1);
          }else{
              value.push(event.target.value);
          }
          if(value[0] === &quot;&quot;){
              value.splice(0, 1);
          }
          value = value.join(&quot;;&quot;);
          setState({
              ...state,
              name: value
          });
      }
  
  &lt;label className=&quot;label-value&quot;&gt;
                      {bridge.parent.arrayNames.map((element, index) =&gt; (
                          &lt;label key={index.key}&gt;
                              {element.name}
                              &lt;Checkbox value={element.name}
                                      onChange={onNameChange}/&gt;
                          &lt;/label&gt;
                      ))}
                  &lt;/label&gt;
  </code></pre>