{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/react/issues/7827","repository_url":"https://api.github.com/repos/facebook/react","labels_url":"https://api.github.com/repos/facebook/react/issues/7827/labels{/name}","comments_url":"https://api.github.com/repos/facebook/react/issues/7827/comments","events_url":"https://api.github.com/repos/facebook/react/issues/7827/events","html_url":"https://github.com/facebook/react/issues/7827","id":179912414,"number":7827,"title":"Unexpected interleaving of subtree/parent lifecycle methods","user":{"login":"vsiao","id":980673,"avatar_url":"https://avatars.githubusercontent.com/u/980673?v=3","gravatar_id":"","url":"https://api.github.com/users/vsiao","html_url":"https://github.com/vsiao","followers_url":"https://api.github.com/users/vsiao/followers","following_url":"https://api.github.com/users/vsiao/following{/other_user}","gists_url":"https://api.github.com/users/vsiao/gists{/gist_id}","starred_url":"https://api.github.com/users/vsiao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vsiao/subscriptions","organizations_url":"https://api.github.com/users/vsiao/orgs","repos_url":"https://api.github.com/users/vsiao/repos","events_url":"https://api.github.com/users/vsiao/events{/privacy}","received_events_url":"https://api.github.com/users/vsiao/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/facebook/react/labels/Type:%20Bug","name":"Type: Bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-28T22:57:44Z","updated_at":"2016-10-27T13:06:53Z","closed_at":null,"body":"Repro: https://jsfiddle.net/5t5ua47c/\r\nIn the example, a click handler in the subtree queues an update for both the the subtree and parent components, with the following ordering of lifecycle methods:\r\n\r\n```\r\nparent will update\r\n> child will update\r\n>> subtree will update\r\n> child did update\r\nparent did update\r\n>> subtree did update\r\n```\r\n\r\nIf the parent component unmounts the subtree in `componentDidUpdate` this will cause the subtree to be unmounted by the time that its `componentDidUpdate` method is called (https://jsfiddle.net/v5fk4xvx/1/):\r\n\r\n```\r\nparent will update\r\n> child will update\r\n>> subtree will update\r\n> child did update\r\nparent did update (unmount subtree)\r\n>> subtree will unmount\r\n>> subtree did update\r\n```\r\n\r\n\r\n**What is the expected behavior?**\r\n\r\nProbably this:\r\n```\r\nparent will update\r\n> child will update\r\n>> subtree will update\r\n> child did update\r\n>> subtree did update\r\nparent did update\r\n```"},"comment":{"url":"https://api.github.com/repos/facebook/react/issues/comments/256635257","html_url":"https://github.com/facebook/react/issues/7827#issuecomment-256635257","issue_url":"https://api.github.com/repos/facebook/react/issues/7827","id":256635257,"user":{"login":"gaearon","id":810438,"avatar_url":"https://avatars.githubusercontent.com/u/810438?v=3","gravatar_id":"","url":"https://api.github.com/users/gaearon","html_url":"https://github.com/gaearon","followers_url":"https://api.github.com/users/gaearon/followers","following_url":"https://api.github.com/users/gaearon/following{/other_user}","gists_url":"https://api.github.com/users/gaearon/gists{/gist_id}","starred_url":"https://api.github.com/users/gaearon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gaearon/subscriptions","organizations_url":"https://api.github.com/users/gaearon/orgs","repos_url":"https://api.github.com/users/gaearon/repos","events_url":"https://api.github.com/users/gaearon/events{/privacy}","received_events_url":"https://api.github.com/users/gaearon/received_events","type":"User","site_admin":false},"created_at":"2016-10-27T13:06:53Z","updated_at":"2016-10-27T13:06:53Z","body":"This looks like a bug to me. I'm not sure it's high priority since we're concentrating on Fiber now (#6170) but it would be great if you could turn this into a failing test case."}}
{"actor":{"display_login":"gaearon"}}