{"action":"closed","number":5528,"pull_request":{"url":"https://api.github.com/repos/facebook/react/pulls/5528","id":51472641,"html_url":"https://github.com/facebook/react/pull/5528","diff_url":"https://github.com/facebook/react/pull/5528.diff","patch_url":"https://github.com/facebook/react/pull/5528.patch","issue_url":"https://api.github.com/repos/facebook/react/issues/5528","number":5528,"state":"closed","locked":false,"title":"Catch errors from component's render()","user":{"login":"XeeD","id":17111,"avatar_url":"https://avatars.githubusercontent.com/u/17111?v=3","gravatar_id":"","url":"https://api.github.com/users/XeeD","html_url":"https://github.com/XeeD","followers_url":"https://api.github.com/users/XeeD/followers","following_url":"https://api.github.com/users/XeeD/following{/other_user}","gists_url":"https://api.github.com/users/XeeD/gists{/gist_id}","starred_url":"https://api.github.com/users/XeeD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/XeeD/subscriptions","organizations_url":"https://api.github.com/users/XeeD/orgs","repos_url":"https://api.github.com/users/XeeD/repos","events_url":"https://api.github.com/users/XeeD/events{/privacy}","received_events_url":"https://api.github.com/users/XeeD/received_events","type":"User","site_admin":false},"body":"This is an attempt at fixing #2461\r\n\r\nIf a Component's `render()` function throws an error we catch it, display a warning in the console and then we throw the error using `setTimeout` so that React does not get into inconsistent state but the error is not swallowed and bubbles to the top.\r\n\r\nPlease let us know if this is the right direction. We are really not sure about the usage of `setTimeout`, it feels like a dirty hack. The reason for its usage is to not silently fail but to let the error propagate to the top. But we cannot do it synchronously because otherwise React will end up in state that is \"beyond repair\".\r\n\r\nWe worked on this PR together with @LeZuse\r\n\r\nSee the test case here: http://jsfiddle.net/XeeD/pLqphjm4/","created_at":"2015-11-22T19:43:32Z","updated_at":"2016-02-03T23:48:58Z","closed_at":"2016-02-03T23:48:58Z","merged_at":null,"merge_commit_sha":"2c60fbe93c96fd6d43356f665e327de9c2aa2971","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/facebook/react/pulls/5528/commits","review_comments_url":"https://api.github.com/repos/facebook/react/pulls/5528/comments","review_comment_url":"https://api.github.com/repos/facebook/react/pulls/comments{/number}","comments_url":"https://api.github.com/repos/facebook/react/issues/5528/comments","statuses_url":"https://api.github.com/repos/facebook/react/statuses/26479b0073bec4c53f8cfcfcb63729070d3e1dbd","head":{"label":"XeeD:bug/fix-2461-render-throw","ref":"bug/fix-2461-render-throw","sha":"26479b0073bec4c53f8cfcfcb63729070d3e1dbd","user":{"login":"XeeD","id":17111,"avatar_url":"https://avatars.githubusercontent.com/u/17111?v=3","gravatar_id":"","url":"https://api.github.com/users/XeeD","html_url":"https://github.com/XeeD","followers_url":"https://api.github.com/users/XeeD/followers","following_url":"https://api.github.com/users/XeeD/following{/other_user}","gists_url":"https://api.github.com/users/XeeD/gists{/gist_id}","starred_url":"https://api.github.com/users/XeeD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/XeeD/subscriptions","organizations_url":"https://api.github.com/users/XeeD/orgs","repos_url":"https://api.github.com/users/XeeD/repos","events_url":"https://api.github.com/users/XeeD/events{/privacy}","received_events_url":"https://api.github.com/users/XeeD/received_events","type":"User","site_admin":false},"repo":{"id":46676210,"name":"react","full_name":"XeeD/react","owner":{"login":"XeeD","id":17111,"avatar_url":"https://avatars.githubusercontent.com/u/17111?v=3","gravatar_id":"","url":"https://api.github.com/users/XeeD","html_url":"https://github.com/XeeD","followers_url":"https://api.github.com/users/XeeD/followers","following_url":"https://api.github.com/users/XeeD/following{/other_user}","gists_url":"https://api.github.com/users/XeeD/gists{/gist_id}","starred_url":"https://api.github.com/users/XeeD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/XeeD/subscriptions","organizations_url":"https://api.github.com/users/XeeD/orgs","repos_url":"https://api.github.com/users/XeeD/repos","events_url":"https://api.github.com/users/XeeD/events{/privacy}","received_events_url":"https://api.github.com/users/XeeD/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/XeeD/react","description":"A declarative, efficient, and flexible JavaScript library for building user interfaces.","fork":true,"url":"https://api.github.com/repos/XeeD/react","forks_url":"https://api.github.com/repos/XeeD/react/forks","keys_url":"https://api.github.com/repos/XeeD/react/keys{/key_id}","collaborators_url":"https://api.github.com/repos/XeeD/react/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/XeeD/react/teams","hooks_url":"https://api.github.com/repos/XeeD/react/hooks","issue_events_url":"https://api.github.com/repos/XeeD/react/issues/events{/number}","events_url":"https://api.github.com/repos/XeeD/react/events","assignees_url":"https://api.github.com/repos/XeeD/react/assignees{/user}","branches_url":"https://api.github.com/repos/XeeD/react/branches{/branch}","tags_url":"https://api.github.com/repos/XeeD/react/tags","blobs_url":"https://api.github.com/repos/XeeD/react/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/XeeD/react/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/XeeD/react/git/refs{/sha}","trees_url":"https://api.github.com/repos/XeeD/react/git/trees{/sha}","statuses_url":"https://api.github.com/repos/XeeD/react/statuses/{sha}","languages_url":"https://api.github.com/repos/XeeD/react/languages","stargazers_url":"https://api.github.com/repos/XeeD/react/stargazers","contributors_url":"https://api.github.com/repos/XeeD/react/contributors","subscribers_url":"https://api.github.com/repos/XeeD/react/subscribers","subscription_url":"https://api.github.com/repos/XeeD/react/subscription","commits_url":"https://api.github.com/repos/XeeD/react/commits{/sha}","git_commits_url":"https://api.github.com/repos/XeeD/react/git/commits{/sha}","comments_url":"https://api.github.com/repos/XeeD/react/comments{/number}","issue_comment_url":"https://api.github.com/repos/XeeD/react/issues/comments{/number}","contents_url":"https://api.github.com/repos/XeeD/react/contents/{+path}","compare_url":"https://api.github.com/repos/XeeD/react/compare/{base}...{head}","merges_url":"https://api.github.com/repos/XeeD/react/merges","archive_url":"https://api.github.com/repos/XeeD/react/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/XeeD/react/downloads","issues_url":"https://api.github.com/repos/XeeD/react/issues{/number}","pulls_url":"https://api.github.com/repos/XeeD/react/pulls{/number}","milestones_url":"https://api.github.com/repos/XeeD/react/milestones{/number}","notifications_url":"https://api.github.com/repos/XeeD/react/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/XeeD/react/labels{/name}","releases_url":"https://api.github.com/repos/XeeD/react/releases{/id}","deployments_url":"https://api.github.com/repos/XeeD/react/deployments","created_at":"2015-11-22T19:30:51Z","updated_at":"2015-11-22T19:30:58Z","pushed_at":"2015-11-22T21:10:46Z","git_url":"git://github.com/XeeD/react.git","ssh_url":"git@github.com:XeeD/react.git","clone_url":"https://github.com/XeeD/react.git","svn_url":"https://github.com/XeeD/react","homepage":"https://facebook.github.io/react/","size":71534,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"facebook:master","ref":"master","sha":"c5867ea401eee56ed40cdfb121d76c508ebc0826","user":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"repo":{"id":10270250,"name":"react","full_name":"facebook/react","owner":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/facebook/react","description":"A declarative, efficient, and flexible JavaScript library for building user interfaces.","fork":false,"url":"https://api.github.com/repos/facebook/react","forks_url":"https://api.github.com/repos/facebook/react/forks","keys_url":"https://api.github.com/repos/facebook/react/keys{/key_id}","collaborators_url":"https://api.github.com/repos/facebook/react/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/facebook/react/teams","hooks_url":"https://api.github.com/repos/facebook/react/hooks","issue_events_url":"https://api.github.com/repos/facebook/react/issues/events{/number}","events_url":"https://api.github.com/repos/facebook/react/events","assignees_url":"https://api.github.com/repos/facebook/react/assignees{/user}","branches_url":"https://api.github.com/repos/facebook/react/branches{/branch}","tags_url":"https://api.github.com/repos/facebook/react/tags","blobs_url":"https://api.github.com/repos/facebook/react/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/facebook/react/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/facebook/react/git/refs{/sha}","trees_url":"https://api.github.com/repos/facebook/react/git/trees{/sha}","statuses_url":"https://api.github.com/repos/facebook/react/statuses/{sha}","languages_url":"https://api.github.com/repos/facebook/react/languages","stargazers_url":"https://api.github.com/repos/facebook/react/stargazers","contributors_url":"https://api.github.com/repos/facebook/react/contributors","subscribers_url":"https://api.github.com/repos/facebook/react/subscribers","subscription_url":"https://api.github.com/repos/facebook/react/subscription","commits_url":"https://api.github.com/repos/facebook/react/commits{/sha}","git_commits_url":"https://api.github.com/repos/facebook/react/git/commits{/sha}","comments_url":"https://api.github.com/repos/facebook/react/comments{/number}","issue_comment_url":"https://api.github.com/repos/facebook/react/issues/comments{/number}","contents_url":"https://api.github.com/repos/facebook/react/contents/{+path}","compare_url":"https://api.github.com/repos/facebook/react/compare/{base}...{head}","merges_url":"https://api.github.com/repos/facebook/react/merges","archive_url":"https://api.github.com/repos/facebook/react/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/facebook/react/downloads","issues_url":"https://api.github.com/repos/facebook/react/issues{/number}","pulls_url":"https://api.github.com/repos/facebook/react/pulls{/number}","milestones_url":"https://api.github.com/repos/facebook/react/milestones{/number}","notifications_url":"https://api.github.com/repos/facebook/react/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/facebook/react/labels{/name}","releases_url":"https://api.github.com/repos/facebook/react/releases{/id}","deployments_url":"https://api.github.com/repos/facebook/react/deployments","created_at":"2013-05-24T16:15:54Z","updated_at":"2016-02-03T22:48:08Z","pushed_at":"2016-02-03T22:39:12Z","git_url":"git://github.com/facebook/react.git","ssh_url":"git@github.com:facebook/react.git","clone_url":"https://github.com/facebook/react.git","svn_url":"https://github.com/facebook/react","homepage":"https://facebook.github.io/react/","size":95571,"stargazers_count":35854,"watchers_count":35854,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":5857,"mirror_url":null,"open_issues_count":577,"forks":5857,"open_issues":577,"watchers":35854,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/facebook/react/pulls/5528"},"html":{"href":"https://github.com/facebook/react/pull/5528"},"issue":{"href":"https://api.github.com/repos/facebook/react/issues/5528"},"comments":{"href":"https://api.github.com/repos/facebook/react/issues/5528/comments"},"review_comments":{"href":"https://api.github.com/repos/facebook/react/pulls/5528/comments"},"review_comment":{"href":"https://api.github.com/repos/facebook/react/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/facebook/react/pulls/5528/commits"},"statuses":{"href":"https://api.github.com/repos/facebook/react/statuses/26479b0073bec4c53f8cfcfcb63729070d3e1dbd"}},"merged":false,"mergeable":true,"mergeable_state":"clean","merged_by":null,"comments":8,"review_comments":0,"commits":1,"additions":22,"deletions":2,"changed_files":2}}