title: How implement render logic with promise inside?
body: <p>I begin read in React.js and faced with occurred. I make get request to the server, in the answer is get json file. I is parse this json and since this promise is return the fulfilled, should start 'then', but my renderRoomList() nothing return and i get error. How to implement logic correctly? Func 'renderRoomList' should return to the render, only after get data from server  </p>
  
  <pre><code>load() {
      var result = []
      var promise = new Promise((resolve, reject) =&gt; {
         fetch('url', {method: 'GET'})
         .then(response =&gt; {
              if(response.ok) {
                  return response.json();
              } else {
                  throw new Error('error');
              }
          })
          .then(//parsed json and add to result array)
      };
      promise.then(() =&gt; {
              return(&lt;div&gt;{result}&lt;/div&gt;)
          }
      return //what return?
  
  }
  </code></pre>