mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
[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:
committed by
Andrew Clark
parent
ca2c71c0c5
commit
8095ebaae7
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user