{"action":"created","issue":{"url":"https://api.github.com/repos/developit/preact/issues/1151","repository_url":"https://api.github.com/repos/developit/preact","labels_url":"https://api.github.com/repos/developit/preact/issues/1151/labels{/name}","comments_url":"https://api.github.com/repos/developit/preact/issues/1151/comments","events_url":"https://api.github.com/repos/developit/preact/issues/1151/events","html_url":"https://github.com/developit/preact/issues/1151","id":334032421,"node_id":"MDU6SXNzdWUzMzQwMzI0MjE=","number":1151,"title":"How to destroy root Preact node?","user":{"login":"DanielApt","id":52545,"node_id":"MDQ6VXNlcjUyNTQ1","avatar_url":"https://avatars1.githubusercontent.com/u/52545?v=4","gravatar_id":"","url":"https://api.github.com/users/DanielApt","html_url":"https://github.com/DanielApt","followers_url":"https://api.github.com/users/DanielApt/followers","following_url":"https://api.github.com/users/DanielApt/following{/other_user}","gists_url":"https://api.github.com/users/DanielApt/gists{/gist_id}","starred_url":"https://api.github.com/users/DanielApt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanielApt/subscriptions","organizations_url":"https://api.github.com/users/DanielApt/orgs","repos_url":"https://api.github.com/users/DanielApt/repos","events_url":"https://api.github.com/users/DanielApt/events{/privacy}","received_events_url":"https://api.github.com/users/DanielApt/received_events","type":"User","site_admin":false},"labels":[{"id":258981564,"node_id":"MDU6TGFiZWwyNTg5ODE1NjQ=","url":"https://api.github.com/repos/developit/preact/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-06-20T11:18:16Z","updated_at":"2018-07-24T21:05:19Z","closed_at":null,"author_association":"NONE","body":"I want to destroy the root Preact DOM node. I initially render my component as follows:\r\n\r\n```js\r\nimport { h, render } from 'preact';\r\nimport App from \"./components/App\";\r\n\r\nrender(<App />, document.querySelector(\"#app\");\r\n```\r\n\r\nHow do I destroy `App`? Do I simply unmount the `#app` DOM node, or does Preact offer a method similar to React's [`unmountComponentAtNode()`](https://reactjs.org/docs/react-dom.html#unmountcomponentatnode) method?"},"comment":{"url":"https://api.github.com/repos/developit/preact/issues/comments/407551972","html_url":"https://github.com/developit/preact/issues/1151#issuecomment-407551972","issue_url":"https://api.github.com/repos/developit/preact/issues/1151","id":407551972,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNzU1MTk3Mg==","user":{"login":"Kanaye","id":5108989,"node_id":"MDQ6VXNlcjUxMDg5ODk=","avatar_url":"https://avatars1.githubusercontent.com/u/5108989?v=4","gravatar_id":"","url":"https://api.github.com/users/Kanaye","html_url":"https://github.com/Kanaye","followers_url":"https://api.github.com/users/Kanaye/followers","following_url":"https://api.github.com/users/Kanaye/following{/other_user}","gists_url":"https://api.github.com/users/Kanaye/gists{/gist_id}","starred_url":"https://api.github.com/users/Kanaye/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kanaye/subscriptions","organizations_url":"https://api.github.com/users/Kanaye/orgs","repos_url":"https://api.github.com/users/Kanaye/repos","events_url":"https://api.github.com/users/Kanaye/events{/privacy}","received_events_url":"https://api.github.com/users/Kanaye/received_events","type":"User","site_admin":false},"created_at":"2018-07-24T21:05:19Z","updated_at":"2018-07-24T21:05:19Z","author_association":"NONE","body":"Preact can't know that the node got removed. Afaik there is no event when a specific node get's removed. So there is no way to call lifecycle hooks when a node get 's removed by `Node.removeChild()` or `Node.remove()` . The node *must* be removed by preact for the lifecycle hooks to be called."}}
{"actor":{"display_login":"Kanaye"}}