Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Jan 6, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion scripts/fiber/tests-failing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions scripts/fiber/tests-passing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,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
Expand Down
4 changes: 4 additions & 0 deletions src/renderers/dom/fiber/ReactDOMFiber.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down