Skip to content

Commit 2badf9d

Browse files
author
Brian Vaughn
committed
Null out deletions array instead of splicing 🤡
1 parent 1503012 commit 2badf9d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎packages/react-reconciler/src/ReactFiberWorkLoop.new.js‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2215,6 +2215,9 @@ function commitMutationEffects(
22152215
) {
22162216
if (fiber.deletions !== null) {
22172217
commitMutationEffectsDeletions(fiber.deletions, root, renderPriorityLevel);
2218+
2219+
// TODO (effects) Don't clear this yet; we may need to cleanup passive effects
2220+
fiber.deletions = null;
22182221
}
22192222

22202223
if (fiber.child !== null) {
@@ -2354,9 +2357,6 @@ function commitMutationEffectsDeletions(
23542357
}
23552358
// Don't clear the Deletion effect yet; we also use it to know when we need to detach refs later.
23562359
}
2357-
2358-
// TODO (effects) Don't clear this yet; we may need to cleanup passive effects
2359-
deletions.splice(0);
23602360
}
23612361

23622362
function commitLayoutEffects(

0 commit comments

Comments
 (0)