title: Map properties to state in react-redux
body: <p>I have a component that uses <code>state</code> to provide data to user. For example <code>&lt;div&gt;this.state.variableInState&lt;/div&gt;</code>. This component can dispatch some method (for example on <code>onClick</code> action). I'm currently using <code>react-redux</code> an <code>connect</code> method to map <code>store</code> to <code>props</code>. Is there a way I can <code>setState</code> after dispatch? </p>
  
  <pre><code>// actions
  export function executeAction() {
    return function (dispatch, getState) {
      dispatch({
        type: 'MY_ACTION',
        payload: axios.get('/some/url')
      });
    };
  }
  // reducer
  
  export default function (state = {}, action) {
    switch (action.type) {
      case 'MY_ACTION_FULFILLED':
        return {...state, myVariable: action.payload.data}
    }
  }
  //component
  class MyComponent extends Component {
    render() {
      (&lt;div onClick={this.props.executeAction.bind(this)}&gt;
        {this.state.variableInState}
        &lt;/div&gt;)
    }
  
    someOtherMethod() {
      // I want to operate with state here, not with props
      // that's why my div gets state from this.state instead of this.props
      this.setState({variableInState: 'someValue'})
    }
  }
  
  
  export default connect((state, ownProperties) =&gt; {
    return {
      // So I want to change MyComponent.state.variableInState here
      // but this method updates MyComponent props only
      // What can I do?
      variableInProps: state.myVariable
    }
  }, {executeAction})(MyComponent);
  </code></pre>