ReactJS - remove parent node and clean up memory
What happens when you remove the Dom node that the ReactJs component shows up in a library like a request? Will React code (and virtual DOM) work in memory to know to clear itself?
React component
var Box = React.createClass({
render: function() {
return (
<div>
Hello, world! I am a Box.
</div>
);
}
});
React.render(<Box/>, document.getElementById('content'));
and then use Jquery later with
$("#content").remove();
I found this feature, however the React component is a third party component and React is bundled, so I don't have access to it.
React.unmountComponentAtNode(document.getElementById('content'));
+3
source to share
No one has answered this question yet
Check out similar questions: