Skip portals when looking for host siblings

A portal is not part of that host tree despite being a child.
This commit is contained in:
Dan Abramov committed 2016-12-09 16:11:35 +00:00
1 parent 3ba8069fef
commit 4596fc48ba
3 files changed
+2 -4

No files matched your search

-3
View File
@@ -18,9 +18,6 @@ src/isomorphic/modern/element/__tests__/ReactJSXElementValidator-test.js
src/renderers/dom/__tests__/ReactDOMProduction-test.js
* should throw with an error code in production
src/renderers/dom/fiber/__tests__/ReactDOMFiber-test.js
* should unwind namespaces on caught errors in a portal
src/renderers/dom/shared/__tests__/ReactDOM-test.js
* throws in render() if the mount callback is not a function
* throws in render() if the update callback is not a function
+1
View File
@@ -519,6 +519,7 @@ src/renderers/dom/fiber/__tests__/ReactDOMFiber-test.js
* should keep track of namespace across portals (complex)
* should unwind namespaces on uncaught errors
* should unwind namespaces on caught errors
* should unwind namespaces on caught errors in a portal
* should pass portal context when rendering subtree elsewhere
* should update portal context if it changes due to setState
* should update portal context if it changes due to re-render
@@ -152,7 +152,7 @@ module.exports = function<T, P, I, TI, C, CX>(
// If we don't have a child, try the siblings instead.
continue siblings;
}
if (!node.child) {
if (!node.child || node.tag === HostPortal) {
continue siblings;
} else {
node.child.return = node;