title: using checkboxes to change state and sort list
body: <p>I have a list like this:</p>
  
  <pre><code>&lt;div className="doubleCol"&gt;
      {this.state.symptoms.map(item =&gt; (
          &lt;ListItem key={item.ObjectID}&gt;
              &lt;input type="checkbox" className="sympSelect" /&gt;
              {item.name}
          &lt;/ListItem&gt;
       ))}
  &lt;/div&gt;
  </code></pre>
  
  <p>All the items rendered have checkbox and I want it to filter a different list elsewhere on the page based on which boxes are checked. To do that I need the checkboxes to change the state and pass the new state to a method which is supposed to filter and display only those items on the second list with id's associated to items on the first list.</p>
  
  <p>From what I have read it shouldn't matter for this purpose if the checkboxes are controlled or uncontrolled.</p>
  
  <pre><code>class Home extends React.Component {
      state = {
          conditions: [],
          symptoms: [],
          selectedSymptom: []
      }
      componentDidMount() {
          this.getConditionsMethod();
          this.getSymptomsMethod();
      }
  
      getConditionsMethod = () =&gt; {
          API.getConditions()
              .then(data =&gt; {
                  console.log(data);
                  data.data.sort((a, b) =&gt; a.name.localeCompare(b.name))
                  this.setState({
                      conditions: data.data
                  })
              })
              .catch(err =&gt; console.log(err))
      };
  
      filterConditionsMethod = () =&gt; {
          API.getConditions()
              .then(data =&gt; {
                  console.log(data);
                  data.data.sort((a, b) =&gt; a.name.localeCompare(b.name));
                  this.setState({
                      selectedSymptom: data.data
                  })
              })
              .catch(err =&gt; console.log(err))
      };
  
  </code></pre>
  
  <p>But I am kind of stuck on how to structure the onChange for when the box is checked and how to make that implement the filter.</p>