Skip to content

Commit

Permalink
Initialize deletions array to null
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Vaughn committed Jul 9, 2020
1 parent caeab4c commit f0669de
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/react-reconciler/src/ReactFiber.new.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ function FiberNode(
// Effects
this.effectTag = NoEffect;
this.subtreeTag = NoEffect;
this.deletions = [];
this.deletions = null;
this.nextEffect = null;

this.firstEffect = null;
Expand Down Expand Up @@ -290,7 +290,7 @@ export function createWorkInProgress(current: Fiber, pendingProps: any): Fiber {
// Reset the effect tag.
workInProgress.effectTag = NoEffect;
workInProgress.subtreeTag = NoEffect;
workInProgress.deletions = [];
workInProgress.deletions = null;

// The effect list is no longer valid.
workInProgress.nextEffect = null;
Expand Down
4 changes: 2 additions & 2 deletions packages/react-reconciler/src/ReactFiberBeginWork.new.js
Original file line number Diff line number Diff line change
Expand Up @@ -2138,11 +2138,11 @@ function updateSuspenseFallbackChildren(
workInProgress.firstEffect = primaryChildFragment.firstEffect;
workInProgress.lastEffect = progressedLastEffect;
progressedLastEffect.nextEffect = null;
workInProgress.deletions = [];
workInProgress.deletions = null;
} else {
// TODO: Reset this somewhere else? Lol legacy mode is so weird.
workInProgress.firstEffect = workInProgress.lastEffect = null;
workInProgress.deletions = [];
workInProgress.deletions = null;
}
} else {
primaryChildFragment = createWorkInProgressOffscreenFiber(
Expand Down

0 comments on commit f0669de

Please sign in to comment.