title: Reactjs findDOMNode on components
body: <p>I have a component which uses another component </p>
  
  <pre><code>render: function(){
      return(
          &lt;div className={"col-md-8 col-md-offset-2"}&gt;
              &lt;form onSubmit={this.handleSubmit}&gt;
                  &lt;div className="panel panel-default"&gt;
                      &lt;div className="panel-body"&gt;
                          &lt;CustomerForm /&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
                  &lt;button type="submit" className={"btn btn-default"} onClick={this.handleFormSubmit} value="Post"&gt;Submit&lt;/button&gt;
              &lt;/form&gt;
          &lt;/div&gt;
      )
  }
  </code></pre>
  
  <p>There is not problem when I try to display the data but,
  <strong>the problem comes when I want to POST the data to my backend using this function</strong> </p>
  
  <pre><code>handleSubmit: function(e) {
          e.preventDefault();
  
          var firstName = React.findDOMNode(this.refs.firstName).value.trim();
  
          if (!firstName) {
              return;
          }
  
          this.props.onCustomerSubmit({firstName: firstName});
          React.findDOMNode(this.refs.firstName).value = '';
  
          return;
  }
  </code></pre>
  
  <p>Because findDOMNode only works on mounted components and  is a child component I get the error <em>Uncaught TypeError: Cannot read property 'value' of null</em> </p>
  
  <p>Is there a good way to solve such a issue? </p>