title: Reactjs setState not working
body: <p>I'm running into an issue where my console is telling me setState is not defind. I'm not sure what I'm doing wrong. I preload the my object (data) in the constructor. I then pass it through to a table where it is displayed. When a user then selects an option from a dropdown it should only show the filtered data. I've bound the function in the constructor so I'm not sure what I've done wrong. Code is below:</p>
  
  <pre><code>import React, {Component} from ‘react’;
  import moment from ‘moment’;
  import {Table} from ‘reactstrap’;
  import classnames from ‘classnames’;
  
  class Tasks extends Component {
  
  
    constructor(props){
  
      super(props);
  
      this.state = {
  
           data: [
          {
            “task_number”:””,
            “work_end”:”10/01/2017”
          },
          {
          etc…
          }
           ]
  
      }
  
      this.checkDate = this.checkDate.bind(this);
    }
  
  
     checkDate(e) {
      let d = moment.format(“MM/DD/YYYY”);
      let currentData = this.state.data;
  
      currentData.filter(function(newData){
         if(newData.work_end &lt; d){
  
           //comes back as undefined
           this.setState({data: newData});
         }
      });
     }
  
    render(){
      const { data } = this.state;
  
  
      let myData = data.map((header, i){
      return (&lt;tr key = {i}&gt;
            &lt;td&gt;{data[i].task_number}&lt;/td&gt;
           &lt;td&gt;{data[i].work_end}&lt;/td&gt;
                       &lt;/tr&gt;)
      });
  
      return(
          &lt;div&gt;
              &lt;table&gt;
                  {myData}
              &lt;/table&gt;
  
          &lt;Input type=“select”
                             name=“assigngroup”
               id=“assigngroup”
              value={this.state.value}
              onChange={this.checkDate}
              /&gt;
          &lt;/div&gt;
      );
    }
  
  
  }
  
  export default Tasks;
  </code></pre>
  
  <p>I've also tried creating a new function and passing it from checkDate, but that failed as well.</p>