From 26c82cea7244c333ee671a02ef976b87faa1d0a5 Mon Sep 17 00:00:00 2001 From: Sebastian Markbage Date: Wed, 21 Dec 2016 00:10:00 -0800 Subject: [PATCH] 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. --- .../shared/fiber/ReactFiberBeginWork.js | 20 +++++-------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/src/renderers/shared/fiber/ReactFiberBeginWork.js b/src/renderers/shared/fiber/ReactFiberBeginWork.js index fb83073396..a1cede0ee3 100644 --- a/src/renderers/shared/fiber/ReactFiberBeginWork.js +++ b/src/renderers/shared/fiber/ReactFiberBeginWork.js @@ -243,6 +243,11 @@ module.exports = function( 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( 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; }