Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

For instance, if I use renderComponent to render to a DOM node, then delete the DOM node manually, did I just leak memory? Is the React component which was rendered to the deleted DOM node pruned?

like image 879
returneax Avatar asked Sep 11 '14 20:09

returneax


1 Answers

You probably leaked memory. Use React.unmountComponentAtNode(node)

like image 164
Paul O'Shannessy Avatar answered Nov 01 '22 23:11

Paul O'Shannessy