title: Returning Promise from action creator in React Native using redux-thunk
body: <p>I have an action creator that is called from my React component:</p>
  
  <pre><code>// ...
  import { connect } from 'react-redux';
  // ...
  import { submitProfile } from '../actions/index';
  
  // ...
  
    onSubmit() {
      const profile = {
        name: this.state.name
        // ...
      };
  
      this.props.submitProfile(profile)
        .then(() =&gt; { // I keep getting an error here saying cannot read property 'then' of undefined...
          console.log("Profile submitted. Redirecting to another scene.");
          this.props.navigator.push({ ... });
        });
    }
  
  export default connect(mapStateToProps, { submitProfile })(MyComponent);
  </code></pre>
  
  <p>The definition of the action creator is something like the following. Note I am using the redux-thunk middleware.</p>
  
  <pre><code>export function submitProfile(profile) {
    return dispatch =&gt; {
      axios.post(`some_url`, profile)
        .then(response =&gt; {
          console.log("Profile submission request was successful!");
  
          dispatch({ ... }); // dispatch some action
  
          // this doesn't seem to do anything . . .
          return Promise.resolve();
        })
        .catch(error =&gt; {
          console.log(error.response.data.error);
        });
    };
  }
  </code></pre>
  
  <p>What I want to be able to do is call the action creator to submit the profile and then after that request was successful, push a new route into the navigator from my component. I just want to be able to determine that the post request was successful so I can push the route; otherwise, I would not push anything, but say an error occurred, try again. </p>
  
  <p>I looked up online and found Promise.resolve(), but it doesn't not seem to solve my problem. I know that I could just do a .then after calling an action creator if I was using the redux-promise middleware. How do I do it with redux-thunk?</p>