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.
Sebastian Markbåge committed
Nov 6, 2025 at 16:03 UTC
37b089a59cc14b6442b27303942d62425f9cea35
1 file changed
+3
-3
packages/react-reconciler/src/ReactFiberCommitViewTransitions.js
+3
-3
@@ -233,7 +233,7 @@ function commitAppearingPairViewTransitions(placement: Fiber): void {
233
}
234
let child = placement.child;
235
while (child !== null) {
236
- if (child.tag === OffscreenComponent && child.memoizedState === null) {
236
+ if (child.tag === OffscreenComponent && child.memoizedState !== null) {
237
// This tree was already hidden so we skip it.
238
} else {
239
commitAppearingPairViewTransitions(child);
@@ -347,7 +347,7 @@ function commitDeletedPairViewTransitions(deletion: Fiber): void {
347
}
348
let child = deletion.child;
349
while (child !== null) {
350
- if (child.tag === OffscreenComponent && child.memoizedState === null) {
350
+ if (child.tag === OffscreenComponent && child.memoizedState !== null) {
351
// This tree was already hidden so we skip it.
352
} else {
353
if (
@@ -550,7 +550,7 @@ function restorePairedViewTransitions(parent: Fiber): void {
550
}
551
let child = parent.child;
552
while (child !== null) {
553
- if (child.tag === OffscreenComponent && child.memoizedState === null) {
553
+ if (child.tag === OffscreenComponent && child.memoizedState !== null) {
554
// This tree was already hidden so we skip it.
555
} else {
556
if (