title: How to access parent ref from child
body: <p>I have some problem to pass the ref to child element in JSX. 
  Please, see the following:</p>
  
  <pre><code>import React from "react";
  import ReactDOM from "react-dom";
  
  class App extends React.Component {
    render() {
      return (
        &lt;div id="parent" ref={element =&gt; (this.parentRef = element)}&gt;
          &lt;canvas id="child" width={this.parentRef.offsetWidth} /&gt;
        &lt;/div&gt;
      );
    }
  }
  
  ReactDOM.render(document.getElementById("app"), &lt;App /&gt;);
  </code></pre>
  
  <p>I want to access <code>#parent</code> width from <code>#child</code>. How it is possible?</p>