title: Render a simple list in React with promises
body: <p>I'm trying to render some content from a service which returns a promise, but I can't figure out how I should return the data in my "return" block.</p>
  
  <p>It's no problem to return some static data, as shown in this example. But how can I return the data from the commented code in the same way?</p>
  
  <p>The image shows the console, where you can see the promise.</p>
  
  <p>I know the answer is probaly very simple, but I just can't wrap my head around it.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>render() {
  
    const data2 = [
     {title:'item one', id:'000'},
     {title:'item two', id:'001'}
    ];
    console.log(data2);
  
    const data = firebaseCon.content.get('text', { fields: ['id', 'title'] });
    console.log(data);
  
    var itemList = data2.map(function(item) {
     return &lt;li className="item" key={item.id}&gt;{item.title}&lt;/li&gt;;
    });
  
    return (
     &lt;ul&gt;
      {itemList}
     &lt;/ul&gt;
    )
   }</code></pre>
  </div>
  </div>
  </p>
  
  <p><a href="https://i.stack.imgur.com/h1qU5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/h1qU5.png" alt="enter image description here"></a></p>