Skip to content

Commit b4745ca

Browse files
author
Brian Vaughn
committed
HostRoot no longer pops context provider in complete phase
Also added an invariant warning to guard against context being popped too many times.
1 parent 369769a commit b4745ca

File tree

2 files changed

+1
-1
lines changed

2 files changed

+1
-1
lines changed

src/renderers/shared/fiber/ReactFiberCompleteWork.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,6 @@ module.exports = function<T, P, I, TI, C, CX>(
202202
return null;
203203
case HostRoot: {
204204
workInProgress.memoizedProps = workInProgress.pendingProps;
205-
popContextProvider();
206205
const fiberRoot = (workInProgress.stateNode : FiberRoot);
207206
if (fiberRoot.pendingContext) {
208207
fiberRoot.context = fiberRoot.pendingContext;

src/renderers/shared/fiber/ReactFiberContext.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ function isContextProvider(fiber : Fiber) : boolean {
7777
exports.isContextProvider = isContextProvider;
7878

7979
function popContextProvider() : void {
80+
invariant(index > -1, 'Unexpected context pop');
8081
contextStack[index] = emptyObject;
8182
didPerformWorkStack[index] = false;
8283
index--;

0 commit comments

Comments
 (0)