Skip to content

Commit d48dbb8

Browse files
authored
Clear more Fiber fields in detachFiber (facebook#18556)
1 parent 0566b70 commit d48dbb8

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1118,6 +1118,7 @@ function detachFiber(fiber: Fiber) {
11181118
// itself will be GC:ed when the parent updates the next time.
11191119
fiber.return = null;
11201120
fiber.child = null;
1121+
fiber.sibling = null;
11211122
fiber.memoizedState = null;
11221123
fiber.updateQueue = null;
11231124
fiber.dependencies = null;
@@ -1127,6 +1128,9 @@ function detachFiber(fiber: Fiber) {
11271128
fiber.pendingProps = null;
11281129
fiber.memoizedProps = null;
11291130
fiber.stateNode = null;
1131+
if (__DEV__) {
1132+
fiber._debugOwner = null;
1133+
}
11301134
}
11311135

11321136
function emptyPortalContainer(current: Fiber) {

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1118,6 +1118,7 @@ function detachFiber(fiber: Fiber) {
11181118
// itself will be GC:ed when the parent updates the next time.
11191119
fiber.return = null;
11201120
fiber.child = null;
1121+
fiber.sibling = null;
11211122
fiber.memoizedState = null;
11221123
fiber.updateQueue = null;
11231124
fiber.dependencies = null;
@@ -1127,6 +1128,9 @@ function detachFiber(fiber: Fiber) {
11271128
fiber.pendingProps = null;
11281129
fiber.memoizedProps = null;
11291130
fiber.stateNode = null;
1131+
if (__DEV__) {
1132+
fiber._debugOwner = null;
1133+
}
11301134
}
11311135

11321136
function emptyPortalContainer(current: Fiber) {

0 commit comments

Comments
 (0)