Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear fiber.sibling field when clearing nextEffect #18970

Merged
merged 2 commits into from May 21, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/react-reconciler/src/ReactFiberWorkLoop.new.js
Expand Up @@ -1993,6 +1993,9 @@ function commitRootImpl(root, renderPriorityLevel) {
while (nextEffect !== null) {
const nextNextEffect = nextEffect.nextEffect;
nextEffect.nextEffect = null;
if (nextEffect.effectTag & Deletion) {
nextEffect.sibling = null;
trueadm marked this conversation as resolved.
Show resolved Hide resolved
}
nextEffect = nextNextEffect;
}
}
Expand Down Expand Up @@ -2447,6 +2450,9 @@ function flushPassiveEffectsImpl() {
const nextNextEffect = effect.nextEffect;
// Remove nextEffect pointer to assist GC
effect.nextEffect = null;
if (effect.effectTag & Deletion) {
effect.sibling = null;
}
effect = nextNextEffect;
}

Expand Down
6 changes: 6 additions & 0 deletions packages/react-reconciler/src/ReactFiberWorkLoop.old.js
Expand Up @@ -2101,6 +2101,9 @@ function commitRootImpl(root, renderPriorityLevel) {
while (nextEffect !== null) {
const nextNextEffect = nextEffect.nextEffect;
nextEffect.nextEffect = null;
if (nextEffect.effectTag & Deletion) {
nextEffect.sibling = null;
}
nextEffect = nextNextEffect;
}
}
Expand Down Expand Up @@ -2595,6 +2598,9 @@ function flushPassiveEffectsImpl() {
const nextNextEffect = effect.nextEffect;
// Remove nextEffect pointer to assist GC
effect.nextEffect = null;
if (effect.effectTag & Deletion) {
effect.sibling = null;
}
effect = nextNextEffect;
}

Expand Down