{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/react/issues/2461","labels_url":"https://api.github.com/repos/facebook/react/issues/2461/labels{/name}","comments_url":"https://api.github.com/repos/facebook/react/issues/2461/comments","events_url":"https://api.github.com/repos/facebook/react/issues/2461/events","html_url":"https://github.com/facebook/react/issues/2461","id":47678610,"number":2461,"title":"Error boundaries: Recover from errors thrown in `render`","user":{"login":"longlho","id":198255,"avatar_url":"https://avatars.githubusercontent.com/u/198255?v=3","gravatar_id":"","url":"https://api.github.com/users/longlho","html_url":"https://github.com/longlho","followers_url":"https://api.github.com/users/longlho/followers","following_url":"https://api.github.com/users/longlho/following{/other_user}","gists_url":"https://api.github.com/users/longlho/gists{/gist_id}","starred_url":"https://api.github.com/users/longlho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/longlho/subscriptions","organizations_url":"https://api.github.com/users/longlho/orgs","repos_url":"https://api.github.com/users/longlho/repos","events_url":"https://api.github.com/users/longlho/events{/privacy}","received_events_url":"https://api.github.com/users/longlho/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2014-11-04T05:13:19Z","updated_at":"2015-06-11T15:31:05Z","closed_at":null,"body":"So I'm trying to put some graceful error handling in case 1 of my views crap out:\r\n\r\n```jsx\r\nvar MyGoodView = React.createClass({\r\n  render: function () {\r\n    return <p>Cool</p>;\r\n  }\r\n});\r\n\r\nvar MyBadView = React.createClass({\r\n  render: function () {\r\n    throw new Error('crap');\r\n  }\r\n});\r\n\r\ntry {\r\n  React.render(<MyBadView/>, document.body);\r\n} catch (e) {\r\n  React.render(<MyGoodView/>, document.body);\r\n}\r\n```\r\n\r\nHowever, `MyGoodView` does not get rendered w/ the following stack trace:\r\n\r\n![stack trace](http://f.cl.ly/items/0G3d3s1G452p3g1q0T2j/Screen%20Shot%202014-11-04%20at%2012.11.43%20AM.png)\r\n\r\nSeems like error throw React in a bad state where `renderedComponent` is `undefined`, thus cannot be unmounted. How do I handle this scenario?"},"comment":{"url":"https://api.github.com/repos/facebook/react/issues/comments/111174365","html_url":"https://github.com/facebook/react/issues/2461#issuecomment-111174365","issue_url":"https://api.github.com/repos/facebook/react/issues/2461","id":111174365,"user":{"login":"moosingin3space","id":830082,"avatar_url":"https://avatars.githubusercontent.com/u/830082?v=3","gravatar_id":"","url":"https://api.github.com/users/moosingin3space","html_url":"https://github.com/moosingin3space","followers_url":"https://api.github.com/users/moosingin3space/followers","following_url":"https://api.github.com/users/moosingin3space/following{/other_user}","gists_url":"https://api.github.com/users/moosingin3space/gists{/gist_id}","starred_url":"https://api.github.com/users/moosingin3space/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moosingin3space/subscriptions","organizations_url":"https://api.github.com/users/moosingin3space/orgs","repos_url":"https://api.github.com/users/moosingin3space/repos","events_url":"https://api.github.com/users/moosingin3space/events{/privacy}","received_events_url":"https://api.github.com/users/moosingin3space/received_events","type":"User","site_admin":false},"created_at":"2015-06-11T15:31:05Z","updated_at":"2015-06-11T15:31:05Z","body":"+1 This makes debugging React apps much more difficult than it has to be!"}}