Skip to content

Commit 80d39d8

Browse files
authored
Remove null sibling (facebook#18687)
1 parent 0960b7b commit 80d39d8

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1116,6 +1116,9 @@ function detachFiber(fiber: Fiber) {
11161116
// get GC:ed but we don't know which for sure which parent is the current
11171117
// one so we'll settle for GC:ing the subtree of this child. This child
11181118
// itself will be GC:ed when the parent updates the next time.
1119+
// Note: we cannot null out sibling here, otherwise it can cause issues
1120+
// with findDOMNode and how it requires the sibling field to carry out
1121+
// traversal in a later effect. See PR #16820.
11191122
fiber.alternate = null;
11201123
fiber.child = null;
11211124
fiber.dependencies = null;
@@ -1125,7 +1128,6 @@ function detachFiber(fiber: Fiber) {
11251128
fiber.memoizedState = null;
11261129
fiber.pendingProps = null;
11271130
fiber.return = null;
1128-
fiber.sibling = null;
11291131
fiber.stateNode = null;
11301132
fiber.updateQueue = null;
11311133
if (__DEV__) {

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1116,6 +1116,9 @@ function detachFiber(fiber: Fiber) {
11161116
// get GC:ed but we don't know which for sure which parent is the current
11171117
// one so we'll settle for GC:ing the subtree of this child. This child
11181118
// itself will be GC:ed when the parent updates the next time.
1119+
// Note: we cannot null out sibling here, otherwise it can cause issues
1120+
// with findDOMNode and how it requires the sibling field to carry out
1121+
// traversal in a later effect. See PR #16820.
11191122
fiber.alternate = null;
11201123
fiber.child = null;
11211124
fiber.dependencies = null;
@@ -1125,7 +1128,6 @@ function detachFiber(fiber: Fiber) {
11251128
fiber.memoizedState = null;
11261129
fiber.pendingProps = null;
11271130
fiber.return = null;
1128-
fiber.sibling = null;
11291131
fiber.stateNode = null;
11301132
fiber.updateQueue = null;
11311133
if (__DEV__) {

0 commit comments

Comments
 (0)