Skip to content

Commit

Permalink
Set and reset current debug fiber in dev
Browse files Browse the repository at this point in the history
  • Loading branch information
sammy-SC committed Aug 15, 2022
1 parent 4a257a3 commit d24df56
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/react-reconciler/src/ReactFiberWorkLoop.old.js
Original file line number Diff line number Diff line change
Expand Up @@ -3021,6 +3021,7 @@ function doubleInvokeEffectsInDEV(
const isStrictModeFiber = fiber.type === REACT_STRICT_MODE_TYPE;
const isInStrictMode = parentIsInStrictMode || isStrictModeFiber;
if (fiber.flags & PlacementDEV || fiber.tag === OffscreenComponent) {
setCurrentDebugFiberInDEV(fiber);
if (isInStrictMode) {
disappearLayoutEffects(fiber);
}
Expand All @@ -3033,6 +3034,7 @@ function doubleInvokeEffectsInDEV(
if (hasPassiveEffects && isInStrictMode) {
reconnectPassiveEffects(root, fiber, NoLanes, null, false);
}
resetCurrentDebugFiberInDEV();
} else {
recursivelyTraverseAndDoubleInvokeEffectsInDEV(
root,
Expand Down

0 comments on commit d24df56

Please sign in to comment.