Printing the results from fetch() in React
<p>I'm trying to recreate the example used in the docs <a href="https://facebook.github.io/react-native/docs/network.html" rel="nofollow noreferrer">https://facebook.github.io/react-native/docs/network.html</a></p>

<pre><code>componentDidMount: function(){
        this.createRow();
    },

createRow : function(){
        var results = fetch('https://facebook.github.io/react-native/movies.json')
            .then((response) =&gt; response.json())
            .then((responseJson) =&gt; {
                return responseJson.movies;
            });
        this.setState({
            'xyz' : results,
            'people' : [{'name':'something_else', 'email':'email@gmail.com'}, {'name':'morgan', 'email':'mogo@gmail.com'}]

        });
    },
</code></pre>

<p>However, when I goto print the results in the <code>render</code> method</p>

<pre><code>render: function(){
        console.log(this.state.xyz)
</code></pre>

<p>I am getting:
<code>undefined</code> the first time the page renders (and <code>xyz</code> hasn't been set, so that makes sense)</p>

<p><code>Promise { &lt;state&gt;: "pending" }</code> the second time when page is rendered (<code>createRow()</code> is run from <code>componentDidMount</code>)</p>

<p>Why am I getting <code>pending</code> state and not the <code>movies</code> object like the example shows? </p>