Skip to content

Commit

Permalink
HostRoot no longer pops context provider in complete phase
Browse files Browse the repository at this point in the history
Also added an invariant warning to guard against context being popped too many times.
  • Loading branch information
Brian Vaughn committed Dec 14, 2016
1 parent 369769a commit b4745ca
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 0 additions & 1 deletion src/renderers/shared/fiber/ReactFiberCompleteWork.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ module.exports = function<T, P, I, TI, C, CX>(
return null;
case HostRoot: {
workInProgress.memoizedProps = workInProgress.pendingProps;
popContextProvider();
const fiberRoot = (workInProgress.stateNode : FiberRoot);
if (fiberRoot.pendingContext) {
fiberRoot.context = fiberRoot.pendingContext;
Expand Down
1 change: 1 addition & 0 deletions src/renderers/shared/fiber/ReactFiberContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ function isContextProvider(fiber : Fiber) : boolean {
exports.isContextProvider = isContextProvider;

function popContextProvider() : void {
invariant(index > -1, 'Unexpected context pop');
contextStack[index] = emptyObject;
didPerformWorkStack[index] = false;
index--;
Expand Down

0 comments on commit b4745ca

Please sign in to comment.