Skip to content

Commit

Permalink
Add comment and make the condition more obvious
Browse files Browse the repository at this point in the history
  • Loading branch information
sammy-SC committed Nov 1, 2022
1 parent 838a7af commit 30f1466
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/react-reconciler/src/ReactFiberCommitWork.new.js
Original file line number Diff line number Diff line change
Expand Up @@ -2880,7 +2880,8 @@ function commitMutationEffectsOnFiber(
}

if (isHidden) {
if (current !== null && current.memoizedState === null) {
// Check if this is an update, and the tree was previously visible.
if (current !== null && !wasHidden) {
if ((offscreenBoundary.mode & ConcurrentMode) !== NoMode) {
// Disappear the layout effects of all the children
recursivelyTraverseDisappearLayoutEffects(offscreenBoundary);
Expand Down
3 changes: 2 additions & 1 deletion packages/react-reconciler/src/ReactFiberCommitWork.old.js
Original file line number Diff line number Diff line change
Expand Up @@ -2880,7 +2880,8 @@ function commitMutationEffectsOnFiber(
}

if (isHidden) {
if (current !== null && current.memoizedState === null) {
// Check if this is an update, and the tree was previously visible.
if (current !== null && !wasHidden) {
if ((offscreenBoundary.mode & ConcurrentMode) !== NoMode) {
// Disappear the layout effects of all the children
recursivelyTraverseDisappearLayoutEffects(offscreenBoundary);
Expand Down

0 comments on commit 30f1466

Please sign in to comment.