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

Reset nextEffect points with the new passive effect feature flag too #18542

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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