Move other branches out of the bail out

This is the same thing as the previous commit but with class, root and portal.

I noticed host and portal now already covers this case in their branches
since pushHostContainer is always at the top.
This commit is contained in:
Sebastian Markbage
2016-12-21 11:34:18 -08:00
parent 9a210114e4
commit 26c82cea72
@@ -243,6 +243,11 @@ module.exports = function<T, P, I, TI, C, CX>(
workInProgress.effectTag |= Update;
}
}
// Don't forget to push the context before returning.
if (isContextProvider(workInProgress)) {
pushContextProvider(workInProgress, false);
}
return bailoutOnAlreadyFinishedWork(current, workInProgress);
}
@@ -515,21 +520,6 @@ module.exports = function<T, P, I, TI, C, CX>(
cloneChildFibers(current, workInProgress);
markChildAsProgressed(current, workInProgress, priorityLevel);
switch (workInProgress.tag) {
case ClassComponent:
if (isContextProvider(workInProgress)) {
pushContextProvider(workInProgress, false);
}
break;
case HostRoot:
case HostPortal:
pushHostContainer(workInProgress.stateNode.containerInfo);
break;
}
// TODO: this is annoyingly duplicating non-jump codepaths.
return workInProgress.child;
}