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

Don't visit passive effects during layout phase #19809

Merged
merged 1 commit into from
Sep 10, 2020
Merged
Show file tree
Hide file tree
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
12 changes: 3 additions & 9 deletions packages/react-reconciler/src/ReactFiberHooks.new.js
Original file line number Diff line number Diff line change
Expand Up @@ -1241,7 +1241,7 @@ function mountEffect(
}
}
return mountEffectImpl(
UpdateEffect | PassiveEffect | PassiveStaticEffect,
PassiveEffect | PassiveStaticEffect,
HookPassive,
create,
deps,
Expand All @@ -1258,12 +1258,7 @@ function updateEffect(
warnIfNotCurrentlyActingEffectsInDEV(currentlyRenderingFiber);
}
}
return updateEffectImpl(
UpdateEffect | PassiveEffect,
HookPassive,
create,
deps,
);
return updateEffectImpl(PassiveEffect, HookPassive, create, deps);
}

function mountLayoutEffect(
Expand Down Expand Up @@ -1615,8 +1610,7 @@ function mountOpaqueIdentifier(): OpaqueIDType | void {
const setId = mountState(id)[1];

if ((currentlyRenderingFiber.mode & BlockingMode) === NoMode) {
currentlyRenderingFiber.flags |=
UpdateEffect | PassiveEffect | PassiveStaticEffect;
currentlyRenderingFiber.flags |= PassiveEffect | PassiveStaticEffect;
pushEffect(
HookHasEffect | HookPassive,
() => {
Expand Down
2 changes: 1 addition & 1 deletion packages/react-reconciler/src/ReactFiberWorkLoop.new.js
Original file line number Diff line number Diff line change
Expand Up @@ -2623,7 +2623,7 @@ function flushPassiveMountEffects(firstChild: Fiber): void {
flushPassiveMountEffects(fiber.child);
}

if ((fiber.flags & Update) !== NoFlags) {
if ((fiber.flags & Passive) !== NoFlags) {
setCurrentDebugFiberInDEV(fiber);
commitPassiveEffectOnFiber(fiber);
resetCurrentDebugFiberInDEV();
Expand Down