mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Reconciler: Combine identical cases in findParent (#32210)
## Summary When lookup `Parent`, `HostRoot` and `HostPortal` should be merged, because when creating a `Portal`, it will also include `containerInfo`(So we can directly use this `containerInfo` to delete the real DOM nodes.), so there is no need to handle them separately. ## How did you test this change? No behavior changes, all existing tests pass.
This commit is contained in:
+1
-5
@@ -2007,11 +2007,7 @@ function commitDeletionEffects(
|
||||
hostParentIsContainer = false;
|
||||
break findParent;
|
||||
}
|
||||
case HostRoot: {
|
||||
hostParent = parent.stateNode.containerInfo;
|
||||
hostParentIsContainer = true;
|
||||
break findParent;
|
||||
}
|
||||
case HostRoot:
|
||||
case HostPortal: {
|
||||
hostParent = parent.stateNode.containerInfo;
|
||||
hostParentIsContainer = true;
|
||||
|
||||
Reference in New Issue
Block a user