Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Uncaught Error: Invariant Violation: processUpdates(): Unable to find child 2 of element. This probably means the DOM was unexpectedly mutated ...
- /** @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 = [
- <tr onClick={this.handleCollapseClick}><th>Header 1</th><th>Header 2</th><th>Header 3</th></tr>
- ];
- if(!this.state.collapsed){
- rows.push(<tr><th>Row1 1</th><th>Row1 2</th><th>Row1 3</th></tr>);
- }
- rows.push(<tr><th>Footer 1</th><th>Footer 2</th><th>Footer 3</th></tr>);
- return <div>
- <table>
- {rows}
- </table>
- </div>
- }
- });
- module.exports = testComp
- if(!this.state.collapsed){
- rows.push(<tr><th>Row1 1</th><th>Row1 2</th><th>Row1 3</th></tr>);
- }else{
- rows.push(<tr><th>Row2 1</th><th>Row2 2</th><th>Row2 3</th></tr>);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement