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.
Sebastian Markbage committed
Dec 21, 2016 at 00:10 UTC
26c82cea7244c333ee671a02ef976b87faa1d0a5
1 file changed
+5
-15
src/renderers/shared/fiber/ReactFiberBeginWork.js
+5
-15
@@ -243,6 +243,11 @@ module.exports = function<T, P, I, TI, C, CX>(
243
workInProgress.effectTag |= Update;
244
}
245
}
246
+
247
+ // Don't forget to push the context before returning.
248
+ if (isContextProvider(workInProgress)) {
249
+ pushContextProvider(workInProgress, false);
250
+ }
251
return bailoutOnAlreadyFinishedWork(current, workInProgress);
252
}
253
@@ -515,21 +520,6 @@ module.exports = function<T, P, I, TI, C, CX>(
520
521
cloneChildFibers(current, workInProgress);
522
markChildAsProgressed(current, workInProgress, priorityLevel);
518
-
519
- switch (workInProgress.tag) {
520
- case ClassComponent:
521
- if (isContextProvider(workInProgress)) {
522
- pushContextProvider(workInProgress, false);
523
- }
524
- break;
525
- case HostRoot:
526
- case HostPortal:
527
- pushHostContainer(workInProgress.stateNode.containerInfo);
528
- break;
529
- }
530
-
531
- // TODO: this is annoyingly duplicating non-jump codepaths.
532
-
523
return workInProgress.child;
524
}
525