title: How to access props in componentDidMount
body: <p>I'm new to react and I have a problem when passing props to child Component</p>
  <p>I have 2 components: <code>PhotoList</code> and <code>Pagination</code>. In <code>PhotoList</code> component I passing 2 props is <code>currentPage</code> and <code>totalPage</code> for <code>Pagination</code> component.</p>
  <pre><code>&lt;Pagination 
    totalPage={Math.floor(this.state.totalImages/30)+1}
    currentPage={this.state.currentPage}
    clicked={this.pageChanged}
  /&gt;
  </code></pre>
  <p>Inside <code>Pagination</code> component. I have a state and I want to compute <code>range</code> attribute based on <code>currentPage</code> value</p>
  <pre><code>state = {
      range: [],
      startPage: 1,
      maxVisibleButtons: 5
    }
  </code></pre>
  <p>The problem is when I access props in <code>componentDidMount</code>. I receive the <code>totalPage</code> is 1 instead of correct value (in my case is 37) and I got wrong value for <code>range</code> attribute in state</p>
  <p>And another thing is any idea to re-compute <code>range</code> value whenever the value of <code>currentPage</code> changed?</p>