title: React js: Invariant Violation: processUpdates() when rendering a table with a different number of child rows
body: <p>I am getting the following error when my react component is re-rendered after a click event:</p>
  
  <pre><code>Uncaught Error: Invariant Violation: processUpdates(): Unable to find child 2 of element. This probably means the DOM was unexpectedly mutated ...
  </code></pre>
  
  <p>This only happens when my table has a different number of rows than the previously rendered version. For example:</p>
  
  <pre><code>/** @jsx React.DOM */
  
  React = require('react');
  
  var _ = require("underscore");
  
  var testComp = React.createClass({
  
    getInitialState: function () {
      return { 
        collapsed: false
      };
    },
  
    handleCollapseClick: function(){
      this.setState({collapsed: !this.state.collapsed});
    },
  
    render: function() {
  
      var rows = [
        &lt;tr onClick={this.handleCollapseClick}&gt;&lt;th&gt;Header 1&lt;/th&gt;&lt;th&gt;Header 2&lt;/th&gt;&lt;th&gt;Header 3&lt;/th&gt;&lt;/tr&gt;
      ];
  
      if(!this.state.collapsed){
        rows.push(&lt;tr&gt;&lt;th&gt;Row1 1&lt;/th&gt;&lt;th&gt;Row1 2&lt;/th&gt;&lt;th&gt;Row1 3&lt;/th&gt;&lt;/tr&gt;);
      }
  
      rows.push(&lt;tr&gt;&lt;th&gt;Footer 1&lt;/th&gt;&lt;th&gt;Footer 2&lt;/th&gt;&lt;th&gt;Footer 3&lt;/th&gt;&lt;/tr&gt;);
  
      return  &lt;div&gt;
                  &lt;table&gt;
                      {rows}
                  &lt;/table&gt;
              &lt;/div&gt;
    }
  
  });
  
  module.exports = testComp
  </code></pre>
  
  <p>If I render different content, but with the same number of rows, I don't get the error, so if I update the if statement to:</p>
  
  <pre><code>if(!this.state.collapsed){
    rows.push(&lt;tr&gt;&lt;th&gt;Row1 1&lt;/th&gt;&lt;th&gt;Row1 2&lt;/th&gt;&lt;th&gt;Row1 3&lt;/th&gt;&lt;/tr&gt;);
  }else{
    rows.push(&lt;tr&gt;&lt;th&gt;Row2 1&lt;/th&gt;&lt;th&gt;Row2 2&lt;/th&gt;&lt;th&gt;Row2 3&lt;/th&gt;&lt;/tr&gt;);
  }
  </code></pre>
  
  <p>... everything works.</p>
  
  <p>Do I need to force react to re-render the entire component in this case, instead of just the 'changed' elements?</p>