title: Dispatch and setState not working together, but are on their own
body: <p>I have a DatePicker component, when I click on a new date it should set the change the date in the redux store, and also visibly UX-wise. </p>
  
  <p>I'll put my code down below, for some reason in the <code>handleChange</code> function, with both the <code>setState</code> and the <code>this.props.addFitler</code> there firing off, the redux store updates correctly but the UX doesn't. 
  However if I comment out the <code>this.props.addFilter</code> dispatch function, the UX update correctly (and obviously the store doesn't). </p>
  
  <p>Why aren't both of these working together? I've tried changing the order in which they're called, extracting each into another function, using mapDispatchToProps instead of calling the action creator directly, all to no avail.</p>
  
  <p>DatePicker.js:</p>
  
  <pre><code>import DatePicker from 'react-datepicker';
  
  class DatePick extends React.Component {
    constructor(props) {
      super(props);
      this.state = {
        date: moment()
      };
      this.handleChange = this.handleChange.bind(this);
    }
    handleChange(date) {
      const { dashboardName } = this.props;
      const { name } = this.props.column;
      this.props.addFilter(date, dashboardName, name);
      this.setState({date});
    }
    render() {
      return (
        &lt;div style={{display: 'inline-block', fontWeight: 'bold'}}&gt;
          &lt;DatePicker
            dateFormat="DD/MM/YYYY"
            selected={this.state.date}
            onChange={this.handleChange} /&gt;
        &lt;/div&gt;
      );
    }
  }
  
  const mapActionToProps = {
    addFilter
  };
  
  export default connect(null, mapActionToProps)(DatePick);
  </code></pre>
  
  <p>The 'date' parameter that comes through in the handleChange function is a moment object just like the one used to set initialState, so that isn't the issue.</p>
  
  <p>Additional info: If I console log before and after <code>setState()</code> it logs the initial state both times.</p>
  
  <p>Has anyone ran into this problem or have any ideas? If you need to see my redux I can update the post with more code but I don't think that's the problem as it updates the store fine.</p>