Clear `deletions` in `detachFiber` (#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.
Andrew Clark committed
Dec 8, 2020 at 19:13 UTC
7659949d6515e7895b8e67b2777bbfd2ef8d5163
2 files changed
+2
packages/react-reconciler/src/ReactFiberCommitWork.new.js
+1
@@ -1074,6 +1074,7 @@ function detachFiberMutation(fiber: Fiber) {
1074
// and one of its descendants throws while unmounting a passive effect.
1075
fiber.alternate = null;
1076
fiber.child = null;
1077
+ fiber.deletions = null;
1078
fiber.dependencies = null;
1079
fiber.firstEffect = null;
1080
fiber.lastEffect = null;
packages/react-reconciler/src/ReactFiberCommitWork.old.js
+1
@@ -1074,6 +1074,7 @@ function detachFiberMutation(fiber: Fiber) {
1074
// and one of its descendants throws while unmounting a passive effect.
1075
fiber.alternate = null;
1076
fiber.child = null;
1077
+ fiber.deletions = null;
1078
fiber.dependencies = null;
1079
fiber.firstEffect = null;
1080
fiber.lastEffect = null;