Skip to content

Commit 3eb1803

Browse files
committed
Rename variable + strongly type stateNode
1 parent 469eaf7 commit 3eb1803

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

packages/react-reconciler/src/ReactFiberBeginWork.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,7 @@ function updateOffscreenComponent(
685685
) {
686686
const nextProps: OffscreenProps = workInProgress.pendingProps;
687687
const nextChildren = nextProps.children;
688-
const isPendingDetached =
688+
const nextIsDetached =
689689
(workInProgress.stateNode._pendingVisibility & OffscreenDetached) !== 0;
690690

691691
const prevState: OffscreenState | null =
@@ -697,7 +697,7 @@ function updateOffscreenComponent(
697697
nextProps.mode === 'hidden' ||
698698
(enableLegacyHidden &&
699699
nextProps.mode === 'unstable-defer-without-hiding') ||
700-
isPendingDetached
700+
nextIsDetached
701701
) {
702702
// Rendering a hidden tree.
703703

packages/react-reconciler/src/ReactFiberCommitWork.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2876,18 +2876,19 @@ function commitMutationEffectsOnFiber(
28762876
}
28772877

28782878
commitReconciliationEffects(finishedWork);
2879+
2880+
const offscreenInstance: OffscreenInstance = finishedWork.stateNode;
2881+
28792882
// TODO: Add explicit effect flag to set _current.
2880-
finishedWork.stateNode._current = finishedWork;
2883+
offscreenInstance._current = finishedWork;
28812884

28822885
// Offscreen stores pending changes to visibility in `_pendingVisibility`. This is
28832886
// 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;
28872890

28882891
if (flags & Visibility) {
2889-
const offscreenInstance: OffscreenInstance = finishedWork.stateNode;
2890-
28912892
// Track the current state on the Offscreen instance so we can
28922893
// read it during an event
28932894
if (isHidden) {

0 commit comments

Comments
 (0)