Skip to content

Commit

Permalink
Clear more Fiber fields in detachFiber (#18556)
Browse files Browse the repository at this point in the history
  • Loading branch information
trueadm authored Apr 9, 2020
1 parent 0566b70 commit d48dbb8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/react-reconciler/src/ReactFiberCommitWork.new.js
Original file line number Diff line number Diff line change
Expand Up @@ -1118,6 +1118,7 @@ function detachFiber(fiber: Fiber) {
// itself will be GC:ed when the parent updates the next time.
fiber.return = null;
fiber.child = null;
fiber.sibling = null;
fiber.memoizedState = null;
fiber.updateQueue = null;
fiber.dependencies = null;
Expand All @@ -1127,6 +1128,9 @@ function detachFiber(fiber: Fiber) {
fiber.pendingProps = null;
fiber.memoizedProps = null;
fiber.stateNode = null;
if (__DEV__) {
fiber._debugOwner = null;
}
}

function emptyPortalContainer(current: Fiber) {
Expand Down
4 changes: 4 additions & 0 deletions packages/react-reconciler/src/ReactFiberCommitWork.old.js
Original file line number Diff line number Diff line change
Expand Up @@ -1118,6 +1118,7 @@ function detachFiber(fiber: Fiber) {
// itself will be GC:ed when the parent updates the next time.
fiber.return = null;
fiber.child = null;
fiber.sibling = null;
fiber.memoizedState = null;
fiber.updateQueue = null;
fiber.dependencies = null;
Expand All @@ -1127,6 +1128,9 @@ function detachFiber(fiber: Fiber) {
fiber.pendingProps = null;
fiber.memoizedProps = null;
fiber.stateNode = null;
if (__DEV__) {
fiber._debugOwner = null;
}
}

function emptyPortalContainer(current: Fiber) {
Expand Down

0 comments on commit d48dbb8

Please sign in to comment.