title: Wait for multiple async calls to finish before React render
body: <p>I have a component, which relies on data to be asynchronously retrieved before the content is rendered. If the data is not yet available, the render function will return a Loader component instead:</p>
  
  <pre><code>    if (this.state.loading) {
          return &lt;Loader /&gt;;
      }
  </code></pre>
  
  <p>The state of loading is set to false after the call returns data:</p>
  
  <pre><code>componentDidMount() {
  
          ExternalComponent.fetchData().then(response =&gt; {
              this.setState({
                  loading: false,
                  data: response
              });
          });
  }
  </code></pre>
  
  <p>This works ok, but what if I wanted to add in another async fetch call in parallel? How would I properly wait for both to finish before setting the state of 'loading' to false?</p>