React是否自动修剪已从DOM中删除其挂载点的组件

Does React automatically prune components which have had their mount points removed from the DOM?

本文关键字:删除 组件 DOM 是否 修剪 React      更新时间:2023-09-26

例如,如果我使用renderComponent渲染到DOM节点,然后手动删除该DOM节点,我只是泄漏了内存吗?呈现到已删除DOM节点的React组件是否已修剪?

您可能泄露了内存。使用React.unmountComponentAtNode(node)