Title: When using React components inside Angular ones, they are attached to the root of the VDOM tree & not removed · Issue #1 · microsoft/angular-react · GitHub
Open Graph Title: When using React components inside Angular ones, they are attached to the root of the VDOM tree & not removed · Issue #1 · microsoft/angular-react
X Title: When using React components inside Angular ones, they are attached to the root of the VDOM tree & not removed · Issue #1 · microsoft/angular-react
Description: From Ben Grynhaus (@bengry) on July 22, 2018 7:57 When having the following structure: React -> (via ReactContent) Angular -> React, the inner React component is attached to the root of the VDOM: Instead of being nested under the ReactCo...
Open Graph Description: From Ben Grynhaus (@bengry) on July 22, 2018 7:57 When having the following structure: React -> (via ReactContent) Angular -> React, the inner React component is attached to the root of the VDOM: I...
X Description: From Ben Grynhaus (@bengry) on July 22, 2018 7:57 When having the following structure: React -> (via ReactContent) Angular -> React, the inner React component is attached to the root of the V...
Opengraph URL: https://github.com/microsoft/angular-react/issues/1
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"When using React components inside Angular ones, they are attached to the root of the VDOM tree & not removed","articleBody":"_From @bengry on July 22, 2018 7:57_\n\nWhen having the following structure: `React -> (via ReactContent) Angular -> React`,\r\nthe inner React component is attached to the root of the VDOM:\r\n\r\n\r\nInstead of being nested under the `ReactContent` (seen above under the `div` with `key=\"run\"`), it's nested as a root node in the VDOM.\r\nThese nodes are also kept in the VDOM after the DOM element has been removed.\r\n\r\n[Demonstrated here](https://github.com/bengry/angular-react/tree/render-props-memory-leak).\r\n\r\nA workaround for this (but not a solution) by @xjerwa - in `AngularReactRendererFactory`:\r\n```typescript\r\nend() {\r\n if (DEBUG) { console.log('RootRenderer > end > isRenderPending:', this.isRenderPending, 'reactRootNodes:', this.reactRootNodes); }\r\n // Flush any pending React element render updates. This cannot be done\r\n // earlier (as is done for DOM elements) because React element props\r\n // are ReadOnly.\r\n \r\n // Potential fix: manually unmount ReactNodes that don't correspond to a DOM element\r\n for (let i = 0; i \u003c this.reactRootNodes.length; i++) {\r\n const node = this.reactRootNodes[i] as any;\r\n if (!document.contains(node._parent) && ReactDOM.unmountComponentAtNode(node._parent)) {\r\n this.reactRootNodes.splice(i--, 1);\r\n }\r\n }\r\n // End potential fix\r\n \r\n if (this.isRenderPending) {\r\n // Remove root nodes that are pending destroy after render.\r\n this.reactRootNodes = this.reactRootNodes.filter(node => !node.render().destroyPending);\r\n this.isRenderPending = false;\r\n }\r\n}\r\n````\r\n\n\n_Copied from original issue: benfeely/angular-react#13_","author":{"url":"https://github.com/bengry","@type":"Person","name":"bengry"},"datePublished":"2018-08-12T08:05:33Z","url":"https://github.com/microsoft/angular-react/issues/1"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:30bc5f0f-33ce-98f8-64fc-51a385143498 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AE82:EA06E:FBE8D9:14366B3:6B00FC86 |
| html-safe-nonce | 5d4f85d1005b73334af9450dc73b91d6f1cd3b4a31bcba3c0a3c1345bbd3e98b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRTgyOkVBMDZFOkZCRThEOToxNDM2NkIzOjZCMDBGQzg2IiwidmlzaXRvcl9pZCI6IjI4NTk2MzgyMzMwNDg4NzQxMTgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | bfa67bac29a64c21c4f91405538faa377f754a12a4b050a147a69011077f493a |
| hovercard-subject-tag | issue:349793502 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/angular-react/1/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9a22fc2d0edaaeb6e34f4468c3703f6f7381a6fc46b2f16c30eec9f2e12e36ef/microsoft/angular-react/issues/1 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9a22fc2d0edaaeb6e34f4468c3703f6f7381a6fc46b2f16c30eec9f2e12e36ef/microsoft/angular-react/issues/1 |
| og:image:alt | From Ben Grynhaus (@bengry) on July 22, 2018 7:57 When having the following structure: React -> (via ReactContent) Angular -> React, the inner React component is attached to the root of the VDOM: I... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | bengry |
| hostname | github.com |
| expected-hostname | github.com |
| None | e208d86428ec00a57ade75058166297440e8128a01e5287c31a53dc042bbf187 |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/angular-react git https://github.com/microsoft/angular-react.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 144321557 |
| octolytics-dimension-repository_nwo | microsoft/angular-react |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 144321557 |
| octolytics-dimension-repository_network_root_nwo | microsoft/angular-react |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7dafd017fb7809a839c443dba08622af38e63c09 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width