diff --git a/packages/react-reconciler/src/ReactFiberNewContext.new.js b/packages/react-reconciler/src/ReactFiberNewContext.new.js index 8c199b7bdad69..a336089ff75b7 100644 --- a/packages/react-reconciler/src/ReactFiberNewContext.new.js +++ b/packages/react-reconciler/src/ReactFiberNewContext.new.js @@ -133,10 +133,14 @@ export function popProvider( pop(valueCursor, providerFiber); if (isPrimaryRenderer) { context._currentValue = currentValue; - context._currentRenderer = null; + if (__DEV__) { + context._currentRenderer = null; + } } else { context._currentValue2 = currentValue; - context._currentRenderer2 = null; + if (__DEV__) { + context._currentRenderer2 = null; + } } } diff --git a/packages/react-reconciler/src/ReactFiberNewContext.old.js b/packages/react-reconciler/src/ReactFiberNewContext.old.js index b0f67147ebbf7..34da2978dad28 100644 --- a/packages/react-reconciler/src/ReactFiberNewContext.old.js +++ b/packages/react-reconciler/src/ReactFiberNewContext.old.js @@ -133,10 +133,14 @@ export function popProvider( pop(valueCursor, providerFiber); if (isPrimaryRenderer) { context._currentValue = currentValue; - context._currentRenderer = null; + if (__DEV__) { + context._currentRenderer = null; + } } else { context._currentValue2 = currentValue; - context._currentRenderer2 = null; + if (__DEV__) { + context._currentRenderer2 = null; + } } }