title: Implementing async/await function in react-native component
body: <p>I'm trying to implement a function which checks if user is authenticated before rendering the main 'App' component but I can't get my code to run AFTER the promise is resolved. </p>
  
  <pre><code>class App extends Component {
      render() {
          const sagaMiddleware = createSagaMiddleware();
          const reduxStore = createStore(reducers, {}, applyMiddleware(ReduxThunk, sagaMiddleware));
          sagaMiddleware.run(Sagas)
  
          getToken = async () =&gt; {
              const token = await store.get('token')
              .then( (token) =&gt; {
                  if (token !== null)
                      reduxStore.dispatch({type: LOGIN_USER});
              })
              .catch( (error) =&gt; console.log(error) )
          }
  
          getToken();
  
          return (
              &lt;Provider store={reduxStore}&gt;
                  &lt;Router&gt;
                      &lt;Scene key="root"&gt;
                          &lt;Scene key="login" component={ LoginPageContainer } hideNavBar={true}/&gt;
                          &lt;Scene key="feed" component={ RequireAuth(FeedPageContainer) } initial={true} hideNavBar={true}/&gt;
                      &lt;/Scene&gt;
                  &lt;/Router&gt;
              &lt;/Provider&gt;
          )
      }
  }
  
  export default App;
  </code></pre>
  
  <p>The above code works perfectly fine except it renders the component before the getToken() function is completed. I think I may not be completely understanding how async/await works yet. Thanks in advance! </p>