From 00de514f0d6f7cc78005c708551cd4075568549d Mon Sep 17 00:00:00 2001 From: eps1lon Date: Sat, 20 Nov 2021 13:54:10 +0100 Subject: [PATCH] Only need to reset in DEV since we only set in DEV --- packages/react-reconciler/src/ReactFiberNewContext.new.js | 8 ++++++-- packages/react-reconciler/src/ReactFiberNewContext.old.js | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/packages/react-reconciler/src/ReactFiberNewContext.new.js b/packages/react-reconciler/src/ReactFiberNewContext.new.js index 31acdd59d7547..3949b11bb513a 100644 --- a/packages/react-reconciler/src/ReactFiberNewContext.new.js +++ b/packages/react-reconciler/src/ReactFiberNewContext.new.js @@ -141,7 +141,9 @@ export function popProvider( } else { context._currentValue = currentValue; } - context._currentRenderer = null; + if (__DEV__) { + context._currentRenderer = null; + } } else { if ( enableServerContext && @@ -151,7 +153,9 @@ export function popProvider( } 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 d7f7af81141ce..2cfadd7bbeb0a 100644 --- a/packages/react-reconciler/src/ReactFiberNewContext.old.js +++ b/packages/react-reconciler/src/ReactFiberNewContext.old.js @@ -141,7 +141,9 @@ export function popProvider( } else { context._currentValue = currentValue; } - context._currentRenderer = null; + if (__DEV__) { + context._currentRenderer = null; + } } else { if ( enableServerContext && @@ -151,7 +153,9 @@ export function popProvider( } else { context._currentValue2 = currentValue; } - context._currentRenderer2 = null; + if (__DEV__) { + context._currentRenderer2 = null; + } } }