mirror of
https://github.com/facebook/react.git
synced 2026-11-18 20:15:56 +00:00
Fix the bug when switching to a null portal child
If pendingProps is null, we do a bailout in beginWork. This prevents unmounting of the existing child when the new child is null. We fix this by changing portal fiber's pendingProps to be the portal object itself instead of its children. This way, it is never null, and thus doesn't cause a false positive in the bailout condition.
This commit is contained in:
1 parent
3f2129aeee
commit
ed9747deed
5 files changed
+5
-7
No files matched your search
@@ -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 reconcile portal children
|
||||
|
||||
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
|
||||
|
||||
@@ -514,6 +514,7 @@ src/renderers/dom/fiber/__tests__/ReactDOMFiber-test.js
|
||||
* should render one portal
|
||||
* should render many portals
|
||||
* should render nested portals
|
||||
* should reconcile portal children
|
||||
* should keep track of namespace across portals (simple)
|
||||
* should keep track of namespace across portals (medium)
|
||||
* should keep track of namespace across portals (complex)
|
||||
|
||||
Reference in new issue
Block a user