Advertisement
Guest User

Untitled

a guest
Nov 1st, 2014
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. Uncaught Error: Invariant Violation: processUpdates(): Unable to find child 2 of element. This probably means the DOM was unexpectedly mutated ...
  2.  
  3. /** @jsx React.DOM */
  4.  
  5. React = require('react');
  6.  
  7. var _ = require("underscore");
  8.  
  9. var testComp = React.createClass({
  10.  
  11. getInitialState: function () {
  12. return {
  13. collapsed: false
  14. };
  15. },
  16.  
  17. handleCollapseClick: function(){
  18. this.setState({collapsed: !this.state.collapsed});
  19. },
  20.  
  21. render: function() {
  22.  
  23. var rows = [
  24. <tr onClick={this.handleCollapseClick}><th>Header 1</th><th>Header 2</th><th>Header 3</th></tr>
  25. ];
  26.  
  27. if(!this.state.collapsed){
  28. rows.push(<tr><th>Row1 1</th><th>Row1 2</th><th>Row1 3</th></tr>);
  29. }
  30.  
  31. rows.push(<tr><th>Footer 1</th><th>Footer 2</th><th>Footer 3</th></tr>);
  32.  
  33. return <div>
  34. <table>
  35. {rows}
  36. </table>
  37. </div>
  38. }
  39.  
  40. });
  41.  
  42. module.exports = testComp
  43.  
  44. if(!this.state.collapsed){
  45. rows.push(<tr><th>Row1 1</th><th>Row1 2</th><th>Row1 3</th></tr>);
  46. }else{
  47. rows.push(<tr><th>Row2 1</th><th>Row2 2</th><th>Row2 3</th></tr>);
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement