Skip to content

Commit

Permalink
Clean up vestige of useOpaqueIdentifier (#25587)
Browse files Browse the repository at this point in the history
Found some code that was left over from the experimental
useOpaqueIdentifier hook, which we eventually replaced with useId.

This deletes it.
  • Loading branch information
acdlite authored Oct 30, 2022
1 parent bdd3d08 commit 2ac77aa
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 28 deletions.
9 changes: 0 additions & 9 deletions packages/react-reconciler/src/ReactFiberHooks.new.js
Original file line number Diff line number Diff line change
Expand Up @@ -767,8 +767,6 @@ export function resetHooksAfterThrow(): void {
hookTypesUpdateIndexDev = -1;

currentHookNameInDev = null;

isUpdatingOpaqueValueInRenderPhase = false;
}

didScheduleRenderPhaseUpdateDuringThisPass = false;
Expand Down Expand Up @@ -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();

Expand Down
9 changes: 0 additions & 9 deletions packages/react-reconciler/src/ReactFiberHooks.old.js
Original file line number Diff line number Diff line change
Expand Up @@ -767,8 +767,6 @@ export function resetHooksAfterThrow(): void {
hookTypesUpdateIndexDev = -1;

currentHookNameInDev = null;

isUpdatingOpaqueValueInRenderPhase = false;
}

didScheduleRenderPhaseUpdateDuringThisPass = false;
Expand Down Expand Up @@ -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();

Expand Down
6 changes: 1 addition & 5 deletions packages/react-reconciler/src/ReactFiberWorkLoop.new.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,6 @@ import {resetContextDependencies} from './ReactFiberNewContext.new';
import {
resetHooksAfterThrow,
ContextOnlyDispatcher,
getIsUpdatingOpaqueValueInRenderPhaseInDEV,
} from './ReactFiberHooks.new';
import {DefaultCacheDispatcher} from './ReactFiberCache.new';
import {
Expand Down Expand Up @@ -3638,10 +3637,7 @@ if (__DEV__) {

function warnAboutRenderPhaseUpdatesInDEV(fiber) {
if (__DEV__) {
if (
ReactCurrentDebugFiberIsRenderingInDEV &&
!getIsUpdatingOpaqueValueInRenderPhaseInDEV()
) {
if (ReactCurrentDebugFiberIsRenderingInDEV) {
switch (fiber.tag) {
case FunctionComponent:
case ForwardRef:
Expand Down
6 changes: 1 addition & 5 deletions packages/react-reconciler/src/ReactFiberWorkLoop.old.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,6 @@ import {resetContextDependencies} from './ReactFiberNewContext.old';
import {
resetHooksAfterThrow,
ContextOnlyDispatcher,
getIsUpdatingOpaqueValueInRenderPhaseInDEV,
} from './ReactFiberHooks.old';
import {DefaultCacheDispatcher} from './ReactFiberCache.old';
import {
Expand Down Expand Up @@ -3638,10 +3637,7 @@ if (__DEV__) {

function warnAboutRenderPhaseUpdatesInDEV(fiber) {
if (__DEV__) {
if (
ReactCurrentDebugFiberIsRenderingInDEV &&
!getIsUpdatingOpaqueValueInRenderPhaseInDEV()
) {
if (ReactCurrentDebugFiberIsRenderingInDEV) {
switch (fiber.tag) {
case FunctionComponent:
case ForwardRef:
Expand Down

0 comments on commit 2ac77aa

Please sign in to comment.