Skip to content

Commit 13dfcc0

Browse files
acdlitekoto
authored andcommitted
Clear deletions in detachFiber (facebook#20401)
This was added in a later step of the refactor but since `deletions` array already landed, clearing it should, too. I think it's unlikely that this causes GC problems but worth adding anyway.
1 parent a301a46 commit 13dfcc0

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

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

+1
Original file line numberDiff line numberDiff line change
@@ -1074,6 +1074,7 @@ function detachFiberMutation(fiber: Fiber) {
10741074
// and one of its descendants throws while unmounting a passive effect.
10751075
fiber.alternate = null;
10761076
fiber.child = null;
1077+
fiber.deletions = null;
10771078
fiber.dependencies = null;
10781079
fiber.firstEffect = null;
10791080
fiber.lastEffect = null;

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

+1
Original file line numberDiff line numberDiff line change
@@ -1074,6 +1074,7 @@ function detachFiberMutation(fiber: Fiber) {
10741074
// and one of its descendants throws while unmounting a passive effect.
10751075
fiber.alternate = null;
10761076
fiber.child = null;
1077+
fiber.deletions = null;
10771078
fiber.dependencies = null;
10781079
fiber.firstEffect = null;
10791080
fiber.lastEffect = null;

0 commit comments

Comments
 (0)