{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/react/issues/5879","labels_url":"https://api.github.com/repos/facebook/react/issues/5879/labels{/name}","comments_url":"https://api.github.com/repos/facebook/react/issues/5879/comments","events_url":"https://api.github.com/repos/facebook/react/issues/5879/events","html_url":"https://github.com/facebook/react/pull/5879","id":127368428,"number":5879,"title":"#5473 warn and ignore setState and forceUpdate calls if rendered on server","user":{"login":"mdolbin","id":3534827,"avatar_url":"https://avatars.githubusercontent.com/u/3534827?v=3","gravatar_id":"","url":"https://api.github.com/users/mdolbin","html_url":"https://github.com/mdolbin","followers_url":"https://api.github.com/users/mdolbin/followers","following_url":"https://api.github.com/users/mdolbin/following{/other_user}","gists_url":"https://api.github.com/users/mdolbin/gists{/gist_id}","starred_url":"https://api.github.com/users/mdolbin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdolbin/subscriptions","organizations_url":"https://api.github.com/users/mdolbin/orgs","repos_url":"https://api.github.com/users/mdolbin/repos","events_url":"https://api.github.com/users/mdolbin/events{/privacy}","received_events_url":"https://api.github.com/users/mdolbin/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/facebook/react/labels/CLA%20Signed","name":"CLA Signed","color":"e7e7e7"},{"url":"https://api.github.com/repos/facebook/react/labels/GH%20Review:%20review-needed","name":"GH Review: review-needed","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-01-19T05:21:54Z","updated_at":"2016-01-19T18:41:29Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/facebook/react/pulls/5879","html_url":"https://github.com/facebook/react/pull/5879","diff_url":"https://github.com/facebook/react/pull/5879.diff","patch_url":"https://github.com/facebook/react/pull/5879.patch"},"body":"As discussed in the #5473:\r\n>In dev mode, we could mark a component as having been rendered using SSR. If setState or forceUpdate is ever called on such a component, print an intelligent warning."},"comment":{"url":"https://api.github.com/repos/facebook/react/issues/comments/172946169","html_url":"https://github.com/facebook/react/pull/5879#issuecomment-172946169","issue_url":"https://api.github.com/repos/facebook/react/issues/5879","id":172946169,"user":{"login":"jimfb","id":9595985,"avatar_url":"https://avatars.githubusercontent.com/u/9595985?v=3","gravatar_id":"","url":"https://api.github.com/users/jimfb","html_url":"https://github.com/jimfb","followers_url":"https://api.github.com/users/jimfb/followers","following_url":"https://api.github.com/users/jimfb/following{/other_user}","gists_url":"https://api.github.com/users/jimfb/gists{/gist_id}","starred_url":"https://api.github.com/users/jimfb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jimfb/subscriptions","organizations_url":"https://api.github.com/users/jimfb/orgs","repos_url":"https://api.github.com/users/jimfb/repos","events_url":"https://api.github.com/users/jimfb/events{/privacy}","received_events_url":"https://api.github.com/users/jimfb/received_events","type":"User","site_admin":false},"created_at":"2016-01-19T18:41:29Z","updated_at":"2016-01-19T18:41:29Z","body":"I think we can't ignore `setState()` (I know that was @spicyj's idea, but I think he was mistaken about this point).  We should restore the 'allows setState in componentWillMount without using DOM' test, IMO.  cc @spicyj for confirmation\r\n\r\nAlso, we should think through the cases where `setState()` is and isn't legal.  I think `setState` within `componentWillMount` is legal but `setState` within a `setTimeout` is not legal.  Maybe the easiest thing to do is have `instance._isServerSideRendered` point to an object which is created at the beginning of SSR (`{warn: false}`) and mutated at the end of render (set warn to true) to enable warnings on those components."}}