From 2ac77aab94d125942d71e9113d70253eaaef698f Mon Sep 17 00:00:00 2001 From: Andrew Clark Date: Sat, 29 Oct 2022 17:46:54 -0700 Subject: [PATCH] Clean up vestige of useOpaqueIdentifier (#25587) Found some code that was left over from the experimental useOpaqueIdentifier hook, which we eventually replaced with useId. This deletes it. --- packages/react-reconciler/src/ReactFiberHooks.new.js | 9 --------- packages/react-reconciler/src/ReactFiberHooks.old.js | 9 --------- packages/react-reconciler/src/ReactFiberWorkLoop.new.js | 6 +----- packages/react-reconciler/src/ReactFiberWorkLoop.old.js | 6 +----- 4 files changed, 2 insertions(+), 28 deletions(-) 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: