title: React setState not Updating Immediately
body: <p>I'm working on a todo application. This is a very simplified version of the offending code. I have a checkbox:</p>
  
  <pre><code> &lt;p&gt;&lt;input type="checkbox"  name="area" checked={this.state.Pencil}   onChange={this.checkPencil}/&gt; Writing Item &lt;/p&gt;
  </code></pre>
  
  <p>Here's the function that calls the checkbox:</p>
  
  <pre><code>checkPencil(){
     this.setState({
        pencil:!this.state.pencil,
    }); 
    this.props.updateItem(this.state);
  }
  </code></pre>
  
  <p>updateItem is a function that's mapped to dispatch to redux</p>
  
  <pre><code>function mapDispatchToProps(dispatch){
    return bindActionCreators({ updateItem}, dispatch);
  }
  </code></pre>
  
  <p>My problem is that when I call the updateItem action and console.log the state, it is always 1 step behind. If the checkbox is unchecked and not true, I still get the state of true being passed to the updateItem function. Do I need to call another function to force the state to update? </p>