title: React element.scrollHeight in componentDidMount is wrong
body: <p>I'm trying to get the scrollHeight of an element to add a padding to the bottom if it's higher than the offsetHeight but I get in both cases the same value like if the element has not rendered completely or something.</p>
  
  <p>This is how i set it up:</p>
  
  <pre><code>componentDidMount(){
      this.checkHeight();
  }
  componentDidUpdate() {
      this.checkHeight();
  }
  
  checkHeight = () =&gt; {
      if(this.section){
          window.section = this.section;
          console.log(this.section.offsetHeight, this.section.scrollHeight, ReactDOM.findDOMNode(this.section).scrollHeight);
      }
  };
  
  render() {
      return (
          &lt;section className={classes.Admin}&gt;
              &lt;ul className={classes.Navbar}&gt;
                  &lt;NavbarItem link="/admin" exact clicked={this.changeSectionHandler}&gt;Main&lt;/NavbarItem&gt;
                  &lt;NavbarItem link={this.props.match.url + '/users'} clicked={this.changeSectionHandler}&gt;Users&lt;/NavbarItem&gt;
              &lt;/ul&gt;
              &lt;div className={classes.Section} ref={section =&gt; this.section = section}&gt;
                  &lt;Switch&gt;
                      &lt;Route path={this.props.match.url} exact component={Main}/&gt;
                      &lt;Route path={this.props.match.url + '/users'} exact component={Users}/&gt;
                      &lt;Route path={this.props.match.url + '/users/:id'} exact component={Users}/&gt;
                      &lt;Route path={this.props.match.url + '/users/add'} exact component={Users}/&gt;
                      &lt;Redirect to="/admin"/&gt;
                  &lt;/Switch&gt;
              &lt;/div&gt;
          &lt;/section&gt;
      );
  }
  </code></pre>
  
  <p>If i get the values of section.offsetHeight and section.scrollHeight in the console after i loaded the page, they are correct.</p>
  
  <p>I'm definitely stuck here, I learned that componentDidMount get fired only when inner components are mounted but I don't know about componentDidUpdate so I guess the problem is there (when I open the scrollable page the componentDidUpdate function is fired, the componentDidMount is useless for the time being).</p>