title: Accessing this.props in react ComponentDidMount
body: <p>I am new to react and i am stuck on a certain project. The thing is that I have an <code>api_url</code> in <code>this.props</code> received from a parent component. And in this child component I want to use <code>api_url</code> to fetch some data using JSON.</p>
  
  <p>In the parent component I have: </p>
  
  <pre><code>Repositories api_url={this.state.objs.repos_url}
  </code></pre>
  
  <p>and in the child component, I want something like: </p>
  
  <pre><code>componentDidMount() {    
      $.getJSON(this.props.api_url, function(json) {
          for (var i = 0; i &lt; json.length; i++) {
              var each_repo = json[i]
              console.log(each_repo["name"]);
          }    
      });
  }
  </code></pre>
  
  <p>so what I need is the corresponding <code>api_url</code> in the url section of <code>$.getJSON</code>. </p>
  
  <p>Is there a way to access <code>this.props</code> in <code>componentDidMount</code> or is there some other way to achieve the same results?</p>
  
  <p>Another thing regarding this, is that I'm also using a <code>$.getJSON</code> call in the <code>ComponentDidMount</code> of the parent component.</p>
  
  <p>A thanks in advance.</p>