title: Can't find React HTML elements reference width and height
body: <p>After a while messing with my code I don't seem to be able to find the width of an HTML element using the React <code>createRef</code> solution. Below you can see the constructor and how I'm initializing the reference.</p>
  <pre class="lang-js prettyprint-override"><code>constructor(props) {
      super(props);
      this.elementToTrack = React.createRef();
  }
  </code></pre>
  <p>After this, I'm creating the reference on the object I'm wanting to track the size of.</p>
  <pre class="lang-js prettyprint-override"><code>&lt;tr&gt;
      &lt;th ref={this.elementToTrack} className=&quot;upperHeader&quot;&gt;Location&lt;/th&gt;
  &lt;/tr&gt;
  </code></pre>
  <p>At this point, if I was to console the ref it would display the React element/DOM element I'm not entirely sure. but from this, I'm unsure how I'm meant to access its current size properties.</p>
  <p>I've tried the suggestions below with no luck:</p>
  <pre class="lang-js prettyprint-override"><code>this.elementToTrack.current.offsetWidth;
  this.elementToTrack.current.width;
  this.elementToTrack.getBoundingClientRect();
  </code></pre>