title: Asynchronous call in componentWillMount finishes after render method
body: <p>I am trying to perform an asynchronous call to an API in the componentWillMount method. Indeed I would like the <code>render</code> method to executed after the componentWillMount method as I need to pass <code>props</code> to the component in my <code>render</code> method.</p>
  
  <p>Here is my code : </p>
  
  <pre><code>class TennisSearchResultsContainer extends React.Component {
    componentWillMount () {
      // TODO: Build markers for the map
      // TODO: Check courtsResults object and database for tennis court
      this.courtsMarkers = this.props.courtsResults.map((court) =&gt; {
        return new google.maps.Marker({
          position: new google.maps.LatLng(JSON.parse(court.LOC).coordinates[1], JSON.parse(court.LOC).coordinates[0]),
          title: court.NAME,
          animation: google.maps.Animation.DROP
        });
      });
    }
    render () {
      return &lt;TennisSearchResults criterias={this.props.criterias} courtsMarkers={this.courtsMarkers} /&gt;;
    }
  }
  </code></pre>
  
  <p>I don't understand then why my render method seems to do not wait for the asynchronous call to finish and pass undefined props to my child component...</p>
  
  <p>Am I right? And what should I do to fix that? What is the way to handle this?</p>