{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/react/issues/3709","labels_url":"https://api.github.com/repos/facebook/react/issues/3709/labels{/name}","comments_url":"https://api.github.com/repos/facebook/react/issues/3709/comments","events_url":"https://api.github.com/repos/facebook/react/issues/3709/events","html_url":"https://github.com/facebook/react/issues/3709","id":69718035,"number":3709,"title":"Spurious context warning when getChildContext isn't pure","user":{"login":"spicyj","id":6820,"avatar_url":"https://avatars.githubusercontent.com/u/6820?v=3","gravatar_id":"","url":"https://api.github.com/users/spicyj","html_url":"https://github.com/spicyj","followers_url":"https://api.github.com/users/spicyj/followers","following_url":"https://api.github.com/users/spicyj/following{/other_user}","gists_url":"https://api.github.com/users/spicyj/gists{/gist_id}","starred_url":"https://api.github.com/users/spicyj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spicyj/subscriptions","organizations_url":"https://api.github.com/users/spicyj/orgs","repos_url":"https://api.github.com/users/spicyj/repos","events_url":"https://api.github.com/users/spicyj/events{/privacy}","received_events_url":"https://api.github.com/users/spicyj/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/facebook/react/labels/Component:%20Core","name":"Component: Core","color":"5319e7"}],"state":"open","locked":false,"assignee":{"login":"jsfb","id":9595985,"avatar_url":"https://avatars.githubusercontent.com/u/9595985?v=3","gravatar_id":"","url":"https://api.github.com/users/jsfb","html_url":"https://github.com/jsfb","followers_url":"https://api.github.com/users/jsfb/followers","following_url":"https://api.github.com/users/jsfb/following{/other_user}","gists_url":"https://api.github.com/users/jsfb/gists{/gist_id}","starred_url":"https://api.github.com/users/jsfb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsfb/subscriptions","organizations_url":"https://api.github.com/users/jsfb/orgs","repos_url":"https://api.github.com/users/jsfb/repos","events_url":"https://api.github.com/users/jsfb/events{/privacy}","received_events_url":"https://api.github.com/users/jsfb/received_events","type":"User","site_admin":false},"milestone":null,"comments":1,"created_at":"2015-04-21T01:30:24Z","updated_at":"2015-04-21T18:36:22Z","closed_at":null,"body":"@sahrens found a case where we had a component that was creating a new object each time getChildContext was called. This isn't optimal for performance because getChildContext is called for each render, but it looks like we're actually calling it *twice* for each render and warning if the two results aren't the same. This code\r\n\r\n```\r\nvar Parent = React.createClass({\r\n  childContextTypes: {\r\n    x: React.PropTypes.number\r\n  },\r\n  getChildContext: function() {\r\n    return {x: Math.random()};\r\n  },\r\n  render: function() {\r\n    return <Child />;\r\n  }\r\n});\r\n\r\nvar Child = React.createClass({\r\n  contextTypes: {\r\n    x: React.PropTypes.number\r\n  },\r\n  render: function() {\r\n    return <div>x: {this.context.x}</div>;\r\n  }\r\n});\r\n\r\nReact.render(<Parent />, document.body);\r\n```\r\n\r\nproduces warnings like\r\n\r\n```\r\nWarning: owner-based and parent-based contexts differ (values: `0.9166603954508901` vs `0.3767729678656906`) for key (x) while mounting Child (see: http://fb.me/react-context-by-parent)\r\n```"},"comment":{"url":"https://api.github.com/repos/facebook/react/issues/comments/94898990","html_url":"https://github.com/facebook/react/issues/3709#issuecomment-94898990","issue_url":"https://api.github.com/repos/facebook/react/issues/3709","id":94898990,"user":{"login":"jsfb","id":9595985,"avatar_url":"https://avatars.githubusercontent.com/u/9595985?v=3","gravatar_id":"","url":"https://api.github.com/users/jsfb","html_url":"https://github.com/jsfb","followers_url":"https://api.github.com/users/jsfb/followers","following_url":"https://api.github.com/users/jsfb/following{/other_user}","gists_url":"https://api.github.com/users/jsfb/gists{/gist_id}","starred_url":"https://api.github.com/users/jsfb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsfb/subscriptions","organizations_url":"https://api.github.com/users/jsfb/orgs","repos_url":"https://api.github.com/users/jsfb/repos","events_url":"https://api.github.com/users/jsfb/events{/privacy}","received_events_url":"https://api.github.com/users/jsfb/received_events","type":"User","site_admin":false},"created_at":"2015-04-21T18:36:22Z","updated_at":"2015-04-21T18:36:22Z","body":"Fixed by https://github.com/facebook/react/pull/3615/files which removes the warning entirely as part of the switch to parent context."}}