title: Redux Thunk async/await fetch is not working in react native
body: <p>Hi I am trying to call API to create a user but unfortunately, I am able to do so. Can anyone help me here? I am calling an action from the signupScreen.js file and in the action, I am dispatching the function but not sure what's wrong. Here is an example of that.</p>
  <p><strong>singupScreen.js</strong></p>
  <pre><code>import * as AuthActions from &quot;../../../../store/actions/user/auth&quot;;
  ...
  const submitCredentialHandler = useCallback(()=&gt; {
      let newUser = {
          firstName: signupFormState.inputValues.fName,
          lastName: signupFormState.inputValues.lName,
          email: signupFormState.inputValues.email,
          password: signupFormState.inputValues.password,
          gender: signupFormState.inputValues.gender
      }
      AuthActions.register(newUser);
  },[signupFormState]); 
  </code></pre>
  <p><strong>actions/auth.js</strong></p>
  <pre><code>export const register = userRegisterData =&gt; {
      console.log('in action');
      console.log(userRegisterData); // Here it show data
      return async dispatch =&gt; { // Doesn't come under dispatch function.
          console.log('in action 2'); // This is't get printed. 
          try {
              console.log('in action 3');
              const response = await fetch(
                  'https://xyz./rest/V1/customer/register',
                  {
                      method: 'POST',
                      headers: {
                          'Content-Type': &quot;application/json&quot;
                      },
                      body: JSON.stringify(userRegisterData)
                  }
              );
              console.log(response);
              if (!response.ok) {
                  throw new Error('Something went wrong');
              }
              
              const resData = await response.json();
      
              console.log(resData);
              await dispatch({ type: 'REGISTER', user: userRegisterData});
          } catch (error) {
              console.log('in action 5');
              console.log(error);
          }
      }
  }
  </code></pre>
  <p><strong>App.js</strong></p>
  <pre><code>.
  .
  .
  
  import { createStore, combineReducers, applyMiddleware } from &quot;redux&quot;;
  import { Provider } from &quot;react-redux&quot;;
  import ReduxThunk from &quot;redux-thunk&quot;;
  import AuthReducers from &quot;./src/store/reducers/user/auth&quot;;
  
  const App: () =&gt; Node = () =&gt; {
    
    const rootReducers = combineReducers({
      auth: AuthReducers,
      // cart: cartReducer
    });
  
    const store = createStore(rootReducers, applyMiddleware(ReduxThunk));
    
    return (
      &lt;Provider store = { store }&gt;
        &lt;NavigationContainer&gt;
          {/* &lt;SafeAreaView style={backgroundStyle}&gt; */}
            &lt;StatusBar barStyle={'dark-content'} backgroundColor=&quot;white&quot;/&gt;
            &lt;AppNavigationHandler /&gt;
          {/* &lt;/SafeAreaView&gt; */}
        &lt;/NavigationContainer&gt;
      &lt;/Provider&gt;
    );
  };
  
  const styles = StyleSheet.create({
    
  });
  
  export default App;
  </code></pre>
  <p>I am new to this so maybe I am missing or doing anything wrong. Please help to figure out the problem.</p>
  <p>Thanks.</p>