Skip to content

Commit 41cb193

Browse files
author
Brian Vaughn
committed
Null out deletions array instead of splicing 🤡
1 parent 7e879f9 commit 41cb193

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
@@ -2198,6 +2198,9 @@ function commitMutationEffects(
21982198
) {
21992199
if (fiber.deletions !== null) {
22002200
commitMutationEffectsDeletions(fiber.deletions, root, renderPriorityLevel);
2201+
2202+
// TODO (effects) Don't clear this yet; we may need to cleanup passive effects
2203+
fiber.deletions = null;
22012204
}
22022205

22032206
if (fiber.child !== null) {
@@ -2330,9 +2333,6 @@ function commitMutationEffectsDeletions(
23302333
}
23312334
// Don't clear the Deletion effect yet; we also use it to know when we need to detach refs later.
23322335
}
2333-
2334-
// TODO (effects) Don't clear this yet; we may need to cleanup passive effects
2335-
deletions.splice(0);
23362336
}
23372337

23382338
function commitLayoutEffects(

0 commit comments

Comments
 (0)