Skip to content

Commit ec2279d

Browse files
committed
Add null check
1 parent a386d96 commit ec2279d

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

packages/react-reconciler/src/ReactFiberCompleteWork.new.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,8 @@ if (supportsMutation) {
419419
child.return = node;
420420
}
421421
// If Offscreen is not in manual mode, detached tree is hidden from user space.
422-
const _needsVisibilityToggle = node.memoizedProps.mode !== 'manual';
422+
const _needsVisibilityToggle =
423+
node.memoizedProps === null || node.memoizedProps.mode !== 'manual';
423424
appendAllChildrenToContainer(
424425
containerChildSet,
425426
node,

packages/react-reconciler/src/ReactFiberCompleteWork.old.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,8 @@ if (supportsMutation) {
419419
child.return = node;
420420
}
421421
// If Offscreen is not in manual mode, detached tree is hidden from user space.
422-
const _needsVisibilityToggle = node.memoizedProps.mode !== 'manual';
422+
const _needsVisibilityToggle =
423+
node.memoizedProps === null || node.memoizedProps.mode !== 'manual';
423424
appendAllChildrenToContainer(
424425
containerChildSet,
425426
node,

0 commit comments

Comments
 (0)