title: How to call another component from onClick function in ReactJS
body: <p>I am learning Reactjs. I have implemented one sample react app  with rails. I have search a lots to find the solution but I didn't find any. I wanted to call another component from <code>onClick</code> function. But nothing happen. Is that possible what I try to achieve? If yes, then please point me where I do mistake and If not, then which way I can implement. Here is my code:</p>
  
  <pre><code>var Comment = React.createClass({
    render: function () {
      return (
        &lt;div id={"comment_"+ this.props.id }&gt;
          &lt;h4&gt;{ this.props.author } said:&lt;/h4&gt;
          &lt;p&gt;{ this.props.desc }&lt;/p&gt;
          &lt;a href='' onClick={this.handleDelete}&gt;Delete&lt;/a&gt; | #this is for delete which works great
          &lt;a href='' onClick={this.handleEdit}&gt;Edit&lt;/a&gt; 
           # If I put here then it works fine &lt;UpdateComments comments={ this.props} /&gt; but I don't want it here
        &lt;/div&gt;
      )
    },
    handleDelete: function(event) {
      $.ajax({
        url: '/comments/'+ this.props.id,
        type: "DELETE",
        dataType: "json",
        success: function (data) {
         this.setState({ comments: data });
        }.bind(this)
      });
  
    },
    handleEdit: function(event) {
      var Temp = React.createClass({
        render: function(event){
          return(&lt;div&gt;
            &lt;UpdateComments comments={ this.props} /&gt; #here I want to call UpdateComments component
            &lt;/div&gt;
          )
        }
      });
    }
  });
  </code></pre>
  
  <p><strong>Update:</strong>
  If I try below trick then it call the component but reload the page and again disappear called component :(  </p>
  
  <pre><code> handleEdit: function() {
  
      React.render(&lt;UpdateComments comments={ this.props} /&gt; , document.getElementById('comment_'+ this.props.id));
   }
  </code></pre>
  
  <p>any other detail if you required then feel free to ask. Thanks in advance. :)</p>