title: Access Child Element's DOM Node in React
body: <p>I am working with React &amp; SVG.</p>
  
  <p>In order to centre the viewbox on the child <code>&lt;g&gt;</code>, I need to get the 'BBox' value by calling the <code>getBBox()</code> API function on the child <code>&lt;g&gt;</code> element. My code looks like this:</p>
  
  <pre><code>// &lt;SVG&gt; Element
  const SVGParent = React.createClass({
      componentDidMount : function(){
      let eleBBox = ReactDOM.findDOMNode( this.refs.gEle ).getBBox();
  ...
  
  // Child &lt;g&gt; Element
  const TemplateParent = React.createClass({
     render : function(){
        return(
           &lt;g ref = "gEle"&gt;
  ...
  </code></pre>
  
  <p>The above line <code>let eleBBox = ReactDOM.findDOMNOde( this.refs.gEle )</code> returns error:
  <code>TypeError: _reactDom2.default.findDOMNode(...) is null</code></p>
  
  <p>And indeed, the <code>this.refs</code> inside 'SVG' element is empty obj.
  How do I access the child <code>&lt;g&gt;</code> element, so I can access its DOM node?</p>
  
  <p>Thanks,</p>