{"action":"closed","issue":{"url":"https://api.github.com/repos/yahoo/react-intl/issues/660","repository_url":"https://api.github.com/repos/yahoo/react-intl","labels_url":"https://api.github.com/repos/yahoo/react-intl/issues/660/labels{/name}","comments_url":"https://api.github.com/repos/yahoo/react-intl/issues/660/comments","events_url":"https://api.github.com/repos/yahoo/react-intl/issues/660/events","html_url":"https://github.com/yahoo/react-intl/issues/660","id":178950958,"number":660,"title":"Children don't update when context changes","user":{"login":"adowsky","id":10221169,"avatar_url":"https://avatars.githubusercontent.com/u/10221169?v=3","gravatar_id":"","url":"https://api.github.com/users/adowsky","html_url":"https://github.com/adowsky","followers_url":"https://api.github.com/users/adowsky/followers","following_url":"https://api.github.com/users/adowsky/following{/other_user}","gists_url":"https://api.github.com/users/adowsky/gists{/gist_id}","starred_url":"https://api.github.com/users/adowsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adowsky/subscriptions","organizations_url":"https://api.github.com/users/adowsky/orgs","repos_url":"https://api.github.com/users/adowsky/repos","events_url":"https://api.github.com/users/adowsky/events{/privacy}","received_events_url":"https://api.github.com/users/adowsky/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-09-23T19:03:46Z","updated_at":"2016-09-23T21:55:32Z","closed_at":"2016-09-23T21:55:32Z","body":"Hi,\r\nI noticed that IntlProvider blocks update of its children when Provider's parent updates state with objects transferred to context.\r\nIt will be something like that:\r\nParent class:\r\n```\r\nclass Parent extends React.Component{\r\n\tconstructor(props){\r\n\t\tsuper(props);\r\n\t\t\r\n\t\tthis.state = {\r\n\t\t\tsomeContextObject: {}\r\n\t\t};\r\n\t}\r\n\t\r\n\tstatic childContextTypes = {\r\n\t\tsomeContextObject: React.PropTypes.object,\r\n\t};\r\n\t\r\n\tgetChildContext() {\r\n        return {\r\n            someContextObject: this.state.someContextObject,\r\n        };\r\n    }\r\n\t\r\n\trender() {\r\n\t\t return (\r\n\t\t\t<IntlProvider locale=\"en\" messages={myMessages}>\r\n\t\t\t\t<MyDearChild/>\r\n\t\t\t</IntlProvider>\r\n\t\t\t);\r\n\t}\r\n }\r\n```\r\n \r\nMyDearChild's render:\r\n``\r\nrender() {\r\n\t return this.context.someContextObject; // object provided by parent\r\n }\r\n``\r\n \r\nAfter change someContextObject in parent class, ie.\r\n` this.setState({someContextObject: myNewContextObject}) `\r\nchild stays with old context.\r\nIf I remove IntlProvider from parent's render, problem dissapears.\r\n\r\nIs it intentional behaviour or bug?\r\n"}}
{"actor":{"display_login":"adowsky"}}