{"action":"opened","issue":{"url":"https://api.github.com/repos/elastic/kibana/issues/25091","repository_url":"https://api.github.com/repos/elastic/kibana","labels_url":"https://api.github.com/repos/elastic/kibana/issues/25091/labels{/name}","comments_url":"https://api.github.com/repos/elastic/kibana/issues/25091/comments","events_url":"https://api.github.com/repos/elastic/kibana/issues/25091/events","html_url":"https://github.com/elastic/kibana/issues/25091","id":377002849,"node_id":"MDU6SXNzdWUzNzcwMDI4NDk=","number":25091,"title":"[ml/FileDatavisualizer/editFlyout/Overrides] Does not work with React 16.4+","user":{"login":"spalger","id":1329312,"node_id":"MDQ6VXNlcjEzMjkzMTI=","avatar_url":"https://avatars1.githubusercontent.com/u/1329312?v=4","gravatar_id":"","url":"https://api.github.com/users/spalger","html_url":"https://github.com/spalger","followers_url":"https://api.github.com/users/spalger/followers","following_url":"https://api.github.com/users/spalger/following{/other_user}","gists_url":"https://api.github.com/users/spalger/gists{/gist_id}","starred_url":"https://api.github.com/users/spalger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spalger/subscriptions","organizations_url":"https://api.github.com/users/spalger/orgs","repos_url":"https://api.github.com/users/spalger/repos","events_url":"https://api.github.com/users/spalger/events{/privacy}","received_events_url":"https://api.github.com/users/spalger/received_events","type":"User","site_admin":false},"labels":[{"id":912943303,"node_id":"MDU6TGFiZWw5MTI5NDMzMDM=","url":"https://api.github.com/repos/elastic/kibana/labels/:ml","name":":ml","color":"0e8a16","default":false},{"id":26198234,"node_id":"MDU6TGFiZWwyNjE5ODIzNA==","url":"https://api.github.com/repos/elastic/kibana/labels/bug","name":"bug","color":"9e2c2c","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-11-03T00:05:39Z","updated_at":"2018-11-03T00:05:39Z","closed_at":null,"author_association":"MEMBER","body":"When we upgrade to React 16.4+ this component will stop working properly because its use of [`static getDerivedStateFromProps()`](https://github.com/elastic/kibana/blob/4fe2f1de519933d15e864efb647611f90b77d4d2/x-pack/plugins/ml/public/file_datavisualizer/components/edit_flyout/overrides.js#L44-L84) conflicts with the modifications made to state in several of the [`this.setState()`](https://github.com/elastic/kibana/blob/4fe2f1de519933d15e864efb647611f90b77d4d2/x-pack/plugins/ml/public/file_datavisualizer/components/edit_flyout/overrides.js#L108) calls. Starting in React 16.4 the static `getDerivedStateFromProps()` will be called before every render, not just when the props change. As such the state produces in the current implementation will overwrite the modifications made via calls to `this.setState()`."}}
{"actor":{"display_login":"spalger"}}