File tree Expand file tree Collapse file tree 2 files changed +9
-8
lines changed
packages/react-reconciler/src Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -685,7 +685,7 @@ function updateOffscreenComponent(
685
685
) {
686
686
const nextProps : OffscreenProps = workInProgress . pendingProps ;
687
687
const nextChildren = nextProps . children ;
688
- const isPendingDetached =
688
+ const nextIsDetached =
689
689
( workInProgress . stateNode . _pendingVisibility & OffscreenDetached ) !== 0 ;
690
690
691
691
const prevState : OffscreenState | null =
@@ -697,7 +697,7 @@ function updateOffscreenComponent(
697
697
nextProps . mode === 'hidden' ||
698
698
( enableLegacyHidden &&
699
699
nextProps . mode === 'unstable-defer-without-hiding' ) ||
700
- isPendingDetached
700
+ nextIsDetached
701
701
) {
702
702
// Rendering a hidden tree.
703
703
Original file line number Diff line number Diff line change @@ -2876,18 +2876,19 @@ function commitMutationEffectsOnFiber(
2876
2876
}
2877
2877
2878
2878
commitReconciliationEffects ( finishedWork ) ;
2879
+
2880
+ const offscreenInstance : OffscreenInstance = finishedWork . stateNode ;
2881
+
2879
2882
// TODO: Add explicit effect flag to set _current.
2880
- finishedWork . stateNode . _current = finishedWork ;
2883
+ offscreenInstance . _current = finishedWork ;
2881
2884
2882
2885
// Offscreen stores pending changes to visibility in `_pendingVisibility`. This is
2883
2886
// to support batching of `attach` and `detach` calls.
2884
- finishedWork . stateNode . _visibility &= ~ OffscreenDetached ;
2885
- finishedWork . stateNode . _visibility |=
2886
- finishedWork . stateNode . _pendingVisibility & OffscreenDetached ;
2887
+ offscreenInstance . _visibility &= ~ OffscreenDetached ;
2888
+ offscreenInstance . _visibility |=
2889
+ offscreenInstance . _pendingVisibility & OffscreenDetached ;
2887
2890
2888
2891
if ( flags & Visibility ) {
2889
- const offscreenInstance : OffscreenInstance = finishedWork . stateNode ;
2890
-
2891
2892
// Track the current state on the Offscreen instance so we can
2892
2893
// read it during an event
2893
2894
if ( isHidden ) {
You can’t perform that action at this time.
0 commit comments