title: React: How to access refs in this.props.children
body: <p>I want to call a function of a child component.<br>
  Is there a possibility to get refs from this.props.children in React.</p>
  
  <pre><code>var ComponentSection = React.createClass({
  
      componentDidMount: function() {
        // How to access refs in this.props.children ?
        this.refs.inner.refs.specificPanel.resize();
      },
  
      render: function () {
          return (
            &lt;div className="component-section" ref="inner"&gt;
              {this.props.children}
            &lt;/div&gt;
          );
      }
  });
  
  var Panel = React.createClass({
  
      resize: function() {
          console.log('Panel resizing');
      },
  
      render: function () {
          return (
            &lt;div className="Panel"&gt;
              Lorem   ipsum dolor sit amet 
            &lt;/div&gt;
          );
      }
  });
  
  var MainComponent = React.createClass({
      render: function () {
          return (
             &lt;ComponentSection&gt;
              &lt;Panel ref="specificPanel"&gt;&lt;/Panel&gt;
             &lt;/ComponentSection&gt;
          );
      }
  });
  
  ReactDOM.render(
    &lt;MainComponent&gt;&lt;/MainComponent&gt;,
    document.getElementById('container')
  );
  </code></pre>
  
  <p>I made a little demo: <a href="https://jsfiddle.net/69z2wepo/26929/" rel="noreferrer">https://jsfiddle.net/69z2wepo/26929/</a></p>
  
  <p>Thanks in advance </p>