mirror of
https://github.com/zebrajr/react.git
synced 2026-01-15 12:15:22 +00:00
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.
This commit is contained in:
committed by
GitHub
parent
1a31a814f1
commit
37b089a59c
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user