You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected result: rendered text There was an error
Actual result: Uncaught TypeError: Cannot read property 'unmountComponent' of undefined
JSFiddle: http://jsfiddle.net/kb3gN/10167/
The code:
varParent=React.createClass({getInitialState: function(){return{error: false};},componentWillMount: function(){varself=this;// window.onerror is only used for brevitywindow.onerror=function(){if(self.isMounted()){self.setState({error: true});}};},render: function(){if(this.state.error){return<div>There was an error</div>;}else{return<Child/>;}}});varChild=React.createClass({componentWillMount: function(){thrownewError("test error");},render: function(){return<div>Child</div>;}});React.render(<Parent/>,document.body);
The text was updated successfully, but these errors were encountered:
Throwing during the render phase leaves React in a broken state and we're unable to recover. We need to do some major refactoring and introduce better regressions tests to support this. Will close this out and leave it to #2461
Expected result: rendered text
There was an error
Actual result:
Uncaught TypeError: Cannot read property 'unmountComponent' of undefined
JSFiddle: http://jsfiddle.net/kb3gN/10167/
The code:
The text was updated successfully, but these errors were encountered: