Skip to content

Commit

Permalink
Set current fiber during before-mutation traversal (#13219)
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon committed Jul 17, 2018
1 parent fd410f4 commit d6a0626
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/react-reconciler/src/ReactFiberScheduler.js
Expand Up @@ -428,8 +428,11 @@ function commitAllHostEffects() {

function commitBeforeMutationLifecycles() {
while (nextEffect !== null) {
const effectTag = nextEffect.effectTag;
if (__DEV__) {
ReactCurrentFiber.setCurrentFiber(nextEffect);
}

const effectTag = nextEffect.effectTag;
if (effectTag & Snapshot) {
recordEffect();
const current = nextEffect.alternate;
Expand All @@ -440,6 +443,10 @@ function commitBeforeMutationLifecycles() {
// This will be done by commitAllLifeCycles()
nextEffect = nextEffect.nextEffect;
}

if (__DEV__) {
ReactCurrentFiber.resetCurrentFiber();
}
}

function commitAllLifeCycles(
Expand Down

0 comments on commit d6a0626

Please sign in to comment.