It is known that componentWillUnmount()
Before the component will be unloaded , Be performed .
So how to manually unload a component , With ( Trigger the execution of the method to ) Verify the rule ?
Call the following API that will do :ReactDOM.unmountComponentAtNode(container)
.
// Components element Render to container in
ReactDOM.render(element, container);
// uninstall container Components in , timing 5s After execution
setTimeout(function() {
ReactDOM.unmountComponentAtNode(container);
}, 5000);