[Fiber] Throw when attempting to unmount at an invalid node (#8688)

* Throw when attempting to unmount at an invalid node

* Remove extra character after invariant
This commit is contained in:
Brandon Dail
2017-01-05 16:55:17 -08:00
committed by Andrew Clark
parent ca2c71c0c5
commit 8095ebaae7
3 changed files with 5 additions and 1 deletions
-1
View File
@@ -26,7 +26,6 @@ src/renderers/dom/shared/__tests__/ReactDOMTextComponent-test.js
* can reconcile text arbitrarily split into multiple nodes on some substitutions only
src/renderers/dom/shared/__tests__/ReactMount-test.js
* throws when given a non-node
* throws when given a string
* throws when given a factory
* tracks root instances
+1
View File
@@ -752,6 +752,7 @@ src/renderers/dom/shared/__tests__/ReactEventListener-test.js
* should not fire duplicate events for a React DOM tree
src/renderers/dom/shared/__tests__/ReactMount-test.js
* throws when given a non-node
* should render different components in same root
* should unmount and remount if the key changes
* should reuse markup if rendering to the same target twice
+4
View File
@@ -352,6 +352,10 @@ var ReactDOM = {
},
unmountComponentAtNode(container : DOMContainerElement) {
invariant(
isValidContainer(container),
'unmountComponentAtNode(...): Target container is not a DOM element.'
);
warnAboutUnstableUse();
if (container._reactRootContainer) {
// Unmount should not be batched.