From 3eb73f2661e4eb7ba0aa90c67ddab79961249442 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 74c3f5c1c513b..ec410333bb6bd 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 b6a3d18357eff..a885bd708f4db 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; + } } }