From 37b089a59cc14b6442b27303942d62425f9cea35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Markb=C3=A5ge?= Date: Thu, 6 Nov 2025 16:03:02 -0500 Subject: [PATCH] Don't skip content in visible offscreen trees for View Transitions (#35063) Also, don't not skip hidden trees. Memoized state is null when an Offscreen boundary (Suspense or Activity) is visible. This logic was inversed in a couple of View Transition checks which caused pairs to be discovered or not discovered incorrectly for insertion and deletion of Suspense or Activity boundaries. --- .../react-reconciler/src/ReactFiberCommitViewTransitions.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/react-reconciler/src/ReactFiberCommitViewTransitions.js b/packages/react-reconciler/src/ReactFiberCommitViewTransitions.js index c8e59afb88..20abaa673c 100644 --- a/packages/react-reconciler/src/ReactFiberCommitViewTransitions.js +++ b/packages/react-reconciler/src/ReactFiberCommitViewTransitions.js @@ -233,7 +233,7 @@ function commitAppearingPairViewTransitions(placement: Fiber): void { } let child = placement.child; while (child !== null) { - if (child.tag === OffscreenComponent && child.memoizedState === null) { + if (child.tag === OffscreenComponent && child.memoizedState !== null) { // This tree was already hidden so we skip it. } else { commitAppearingPairViewTransitions(child); @@ -347,7 +347,7 @@ function commitDeletedPairViewTransitions(deletion: Fiber): void { } let child = deletion.child; while (child !== null) { - if (child.tag === OffscreenComponent && child.memoizedState === null) { + if (child.tag === OffscreenComponent && child.memoizedState !== null) { // This tree was already hidden so we skip it. } else { if ( @@ -550,7 +550,7 @@ function restorePairedViewTransitions(parent: Fiber): void { } let child = parent.child; while (child !== null) { - if (child.tag === OffscreenComponent && child.memoizedState === null) { + if (child.tag === OffscreenComponent && child.memoizedState !== null) { // This tree was already hidden so we skip it. } else { if (