-
Notifications
You must be signed in to change notification settings - Fork 50.8k
Closed
Description
This throws TypeError: Cannot call method 'removeChild' of null.
http://jsbin.com/caxipewo/1/edit
/** @jsx React.DOM */
var X = React.createClass({
getInitialState: function() {
return {s: 0};
},
render: function() {
if (this.state.s === 0) {
return <div>
<span></span>
</div>;
} else if (this.state.s === 1) {
return <div></div>;
} else {
return <span></span>;
}
},
go: function() {
this.setState({s: 1});
this.setState({s: 2});
this.setState({s: 0});
this.setState({s: 1});
}
});
var Y = React.createClass({
render: function() {
return <div>
<Z />
</div>;
}
});
var Z = React.createClass({
render: function() { return <div />; },
componentWillUpdate: function() {
x.go()
}
});
var xNode = document.getElementById("x");
var yNode = document.getElementById("y");
var x = React.renderComponent(<X />, xNode);
React.renderComponent(<Y />, yNode);
React.renderComponent(<Y />, yNode);Maybe this can be simplified some more but this was the simplest repro I could make.
Thanks @fforw for sending a repro case over.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels