Skip to content

Commit 19ca800

Browse files
authored
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.
1 parent a657bc5 commit 19ca800

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

packages/react-reconciler/src/ReactFiberCommitWork.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -2007,11 +2007,7 @@ function commitDeletionEffects(
20072007
hostParentIsContainer = false;
20082008
break findParent;
20092009
}
2010-
case HostRoot: {
2011-
hostParent = parent.stateNode.containerInfo;
2012-
hostParentIsContainer = true;
2013-
break findParent;
2014-
}
2010+
case HostRoot:
20152011
case HostPortal: {
20162012
hostParent = parent.stateNode.containerInfo;
20172013
hostParentIsContainer = true;

0 commit comments

Comments
 (0)