mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Merge pull request #58 from spicyj/unmount-nothrow
Make unmountAndReleaseReactRootNode not throw
This commit is contained in:
@@ -196,10 +196,14 @@ var ReactMount = {
|
||||
unmountAndReleaseReactRootNode: function(container) {
|
||||
var reactRootID = getReactRootID(container);
|
||||
var component = instanceByReactRootID[reactRootID];
|
||||
// TODO: Consider throwing if no `component` was found.
|
||||
component.unmountComponentFromNode(container);
|
||||
delete instanceByReactRootID[reactRootID];
|
||||
delete containersByReactRootID[reactRootID];
|
||||
if (component) {
|
||||
component.unmountComponentFromNode(container);
|
||||
delete instanceByReactRootID[reactRootID];
|
||||
delete containersByReactRootID[reactRootID];
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user