mirror of
https://github.com/facebook/react.git
synced 2026-11-18 20:15:56 +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:
1 parent
1a31a814f1
commit
37b089a59c
1 file changed
+3
-3
@@ -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