title: Call methods on React children components
body: <p>I want to write a Form component that can export a method to validate its children. Unfortunately a Form does not "see" any methods on its children.</p>
  
  <p>Here is how I define a potential children of Form:</p>
  
  <pre><code>var Input = React.createClass({
    validate: function() {
      ...
    },
  });
  </code></pre>
  
  <p>And here is how I define Form class:</p>
  
  <pre><code>var Form = React.createClass({
    isValid: function() {
      var valid = true;
      this.props.children.forEach(function(component) {
        // --&gt; This iterates over all children that I pass
        if (typeof component.validate === 'function') {
          // --&gt; code never reaches this point
          component.validate();
          valid = valid &amp;&amp; component.isValid();
        }
      });
      return valid;
    }
  });
  </code></pre>
  
  <p>I noticed that I can call a method on a child component using refs, but I cannot call a method via props.children.</p>
  
  <p>Is there a reason for this React behaviour? </p>
  
  <p>How can I fix this?</p>