Skip to content

Commit

Permalink
Reset nextEffect points with the new passive effect feature flag too
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon committed Apr 8, 2020
1 parent b225d4f commit 563d377
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/react-reconciler/src/ReactFiberWorkLoop.js
Original file line number Diff line number Diff line change
Expand Up @@ -2273,6 +2273,8 @@ function flushPassiveEffectsImpl() {
for (let i = 0; i < unmountEffects.length; i += 2) {
const effect = ((unmountEffects[i]: any): HookEffect);
const fiber = ((unmountEffects[i + 1]: any): Fiber);
// Remove nextEffect pointer to assist GC
fiber.nextEffect = null;
const destroy = effect.destroy;
effect.destroy = undefined;
if (typeof destroy === 'function') {
Expand Down Expand Up @@ -2324,6 +2326,8 @@ function flushPassiveEffectsImpl() {
for (let i = 0; i < mountEffects.length; i += 2) {
const effect = ((mountEffects[i]: any): HookEffect);
const fiber = ((mountEffects[i + 1]: any): Fiber);
// Remove nextEffect pointer to assist GC
fiber.nextEffect = null;
if (__DEV__) {
setCurrentDebugFiberInDEV(fiber);
if (
Expand Down

0 comments on commit 563d377

Please sign in to comment.