title: Passing initial state from API call to createStore when react native application boots up
body: <p>I am having trouble initialising my redux-state when my react-native application boots up. I need to make an api call before the application boots up to retrieve data to hydrate my state. Id like to pass the result of this call to the createStore function in my Provider JSX element.
  I have read different things about how to do that but none of them seems to work.</p>
  
  <p>Here's my root App component :</p>
  
  <pre><code>import React, { Component } from 'react';
  import { View } from 'react-native';
  import { Provider } from 'react-redux';
  import { createStore, applyMiddleware } from 'redux';
  import ReduxThunk from 'redux-thunk';
  import reducers from './reducers';
  import RouterComponent from './Router';
  
  class App extends Component {
    render() {
      return (
        &lt;Provider store={createStore(reducers, {}, applyMiddleware(ReduxThunk))}&gt;
          &lt;View style={{ flex: 1 }}&gt;
            &lt;RouterComponent /&gt;
          &lt;/View&gt;
        &lt;/Provider&gt;
      );
    }
  }
  
  
  export default App;
  </code></pre>
  
  <p>I have read and tried different strategies :
  - wrapping the return statement of the render method in the then callback of the api call
  - make the call in componentWillMount or componentDidMount </p>
  
  <p>None of this did work for me. What is the standard way to pass createStore an initial state from an API call when react-native application boots up.</p>