diff --git a/packages/react-reconciler/src/ReactFiberHooks.new.js b/packages/react-reconciler/src/ReactFiberHooks.new.js index af4743e4809cc..1c1f2e6099373 100644 --- a/packages/react-reconciler/src/ReactFiberHooks.new.js +++ b/packages/react-reconciler/src/ReactFiberHooks.new.js @@ -767,8 +767,6 @@ export function resetHooksAfterThrow(): void { hookTypesUpdateIndexDev = -1; currentHookNameInDev = null; - - isUpdatingOpaqueValueInRenderPhase = false; } didScheduleRenderPhaseUpdateDuringThisPass = false; @@ -2380,13 +2378,6 @@ function rerenderTransition(): [ return [isPending, start]; } -let isUpdatingOpaqueValueInRenderPhase = false; -export function getIsUpdatingOpaqueValueInRenderPhaseInDEV(): boolean | void { - if (__DEV__) { - return isUpdatingOpaqueValueInRenderPhase; - } -} - function mountId(): string { const hook = mountWorkInProgressHook(); diff --git a/packages/react-reconciler/src/ReactFiberHooks.old.js b/packages/react-reconciler/src/ReactFiberHooks.old.js index 144a5d7a93a9e..f9fac9358ad7b 100644 --- a/packages/react-reconciler/src/ReactFiberHooks.old.js +++ b/packages/react-reconciler/src/ReactFiberHooks.old.js @@ -767,8 +767,6 @@ export function resetHooksAfterThrow(): void { hookTypesUpdateIndexDev = -1; currentHookNameInDev = null; - - isUpdatingOpaqueValueInRenderPhase = false; } didScheduleRenderPhaseUpdateDuringThisPass = false; @@ -2380,13 +2378,6 @@ function rerenderTransition(): [ return [isPending, start]; } -let isUpdatingOpaqueValueInRenderPhase = false; -export function getIsUpdatingOpaqueValueInRenderPhaseInDEV(): boolean | void { - if (__DEV__) { - return isUpdatingOpaqueValueInRenderPhase; - } -} - function mountId(): string { const hook = mountWorkInProgressHook(); diff --git a/packages/react-reconciler/src/ReactFiberWorkLoop.new.js b/packages/react-reconciler/src/ReactFiberWorkLoop.new.js index ce03757caa4e7..b5271151a5414 100644 --- a/packages/react-reconciler/src/ReactFiberWorkLoop.new.js +++ b/packages/react-reconciler/src/ReactFiberWorkLoop.new.js @@ -205,7 +205,6 @@ import {resetContextDependencies} from './ReactFiberNewContext.new'; import { resetHooksAfterThrow, ContextOnlyDispatcher, - getIsUpdatingOpaqueValueInRenderPhaseInDEV, } from './ReactFiberHooks.new'; import {DefaultCacheDispatcher} from './ReactFiberCache.new'; import { @@ -3638,10 +3637,7 @@ if (__DEV__) { function warnAboutRenderPhaseUpdatesInDEV(fiber) { if (__DEV__) { - if ( - ReactCurrentDebugFiberIsRenderingInDEV && - !getIsUpdatingOpaqueValueInRenderPhaseInDEV() - ) { + if (ReactCurrentDebugFiberIsRenderingInDEV) { switch (fiber.tag) { case FunctionComponent: case ForwardRef: diff --git a/packages/react-reconciler/src/ReactFiberWorkLoop.old.js b/packages/react-reconciler/src/ReactFiberWorkLoop.old.js index 444b8129c0db5..4510f2a31f58f 100644 --- a/packages/react-reconciler/src/ReactFiberWorkLoop.old.js +++ b/packages/react-reconciler/src/ReactFiberWorkLoop.old.js @@ -205,7 +205,6 @@ import {resetContextDependencies} from './ReactFiberNewContext.old'; import { resetHooksAfterThrow, ContextOnlyDispatcher, - getIsUpdatingOpaqueValueInRenderPhaseInDEV, } from './ReactFiberHooks.old'; import {DefaultCacheDispatcher} from './ReactFiberCache.old'; import { @@ -3638,10 +3637,7 @@ if (__DEV__) { function warnAboutRenderPhaseUpdatesInDEV(fiber) { if (__DEV__) { - if ( - ReactCurrentDebugFiberIsRenderingInDEV && - !getIsUpdatingOpaqueValueInRenderPhaseInDEV() - ) { + if (ReactCurrentDebugFiberIsRenderingInDEV) { switch (fiber.tag) { case FunctionComponent: case ForwardRef: