@@ -2096,6 +2096,14 @@ function rerenderOpaqueIdentifier(): OpaqueIDType | void {
2096
2096
return id ;
2097
2097
}
2098
2098
2099
+ function mountId ( ) : string {
2100
+ throw new Error ( 'Not implemented.' ) ;
2101
+ }
2102
+
2103
+ function updateId ( ) : string {
2104
+ throw new Error ( 'Not implemented.' ) ;
2105
+ }
2106
+
2099
2107
function mountRefresh ( ) {
2100
2108
const hook = mountWorkInProgressHook ( ) ;
2101
2109
const refresh = ( hook . memoizedState = refreshCache . bind (
@@ -2412,6 +2420,7 @@ export const ContextOnlyDispatcher: Dispatcher = {
2412
2420
useMutableSource : throwInvalidHookError ,
2413
2421
useSyncExternalStore : throwInvalidHookError ,
2414
2422
useOpaqueIdentifier : throwInvalidHookError ,
2423
+ useId : throwInvalidHookError ,
2415
2424
2416
2425
unstable_isNewReconciler : enableNewReconciler ,
2417
2426
} ;
@@ -2440,6 +2449,7 @@ const HooksDispatcherOnMount: Dispatcher = {
2440
2449
useMutableSource : mountMutableSource ,
2441
2450
useSyncExternalStore : mountSyncExternalStore ,
2442
2451
useOpaqueIdentifier : mountOpaqueIdentifier ,
2452
+ useId : mountId ,
2443
2453
2444
2454
unstable_isNewReconciler : enableNewReconciler ,
2445
2455
} ;
@@ -2468,6 +2478,7 @@ const HooksDispatcherOnUpdate: Dispatcher = {
2468
2478
useMutableSource : updateMutableSource ,
2469
2479
useSyncExternalStore : updateSyncExternalStore ,
2470
2480
useOpaqueIdentifier : updateOpaqueIdentifier ,
2481
+ useId : updateId ,
2471
2482
2472
2483
unstable_isNewReconciler : enableNewReconciler ,
2473
2484
} ;
@@ -2496,6 +2507,7 @@ const HooksDispatcherOnRerender: Dispatcher = {
2496
2507
useMutableSource : updateMutableSource ,
2497
2508
useSyncExternalStore : mountSyncExternalStore ,
2498
2509
useOpaqueIdentifier : rerenderOpaqueIdentifier ,
2510
+ useId : updateId ,
2499
2511
2500
2512
unstable_isNewReconciler : enableNewReconciler ,
2501
2513
} ;
@@ -2667,6 +2679,11 @@ if (__DEV__) {
2667
2679
mountHookTypesDev ( ) ;
2668
2680
return mountOpaqueIdentifier ( ) ;
2669
2681
} ,
2682
+ useId(): string {
2683
+ currentHookNameInDev = 'useId' ;
2684
+ mountHookTypesDev ( ) ;
2685
+ return mountId ( ) ;
2686
+ } ,
2670
2687
2671
2688
unstable_isNewReconciler: enableNewReconciler,
2672
2689
} ;
@@ -2809,6 +2826,11 @@ if (__DEV__) {
2809
2826
updateHookTypesDev ( ) ;
2810
2827
return mountOpaqueIdentifier ( ) ;
2811
2828
} ,
2829
+ useId(): string {
2830
+ currentHookNameInDev = 'useId' ;
2831
+ updateHookTypesDev ( ) ;
2832
+ return mountId ( ) ;
2833
+ } ,
2812
2834
2813
2835
unstable_isNewReconciler: enableNewReconciler,
2814
2836
} ;
@@ -2951,6 +2973,11 @@ if (__DEV__) {
2951
2973
updateHookTypesDev ( ) ;
2952
2974
return updateOpaqueIdentifier ( ) ;
2953
2975
} ,
2976
+ useId(): string {
2977
+ currentHookNameInDev = 'useId' ;
2978
+ updateHookTypesDev ( ) ;
2979
+ return updateId ( ) ;
2980
+ } ,
2954
2981
2955
2982
unstable_isNewReconciler: enableNewReconciler,
2956
2983
} ;
@@ -3094,6 +3121,11 @@ if (__DEV__) {
3094
3121
updateHookTypesDev ( ) ;
3095
3122
return rerenderOpaqueIdentifier ( ) ;
3096
3123
} ,
3124
+ useId(): string {
3125
+ currentHookNameInDev = 'useId' ;
3126
+ updateHookTypesDev ( ) ;
3127
+ return updateId ( ) ;
3128
+ } ,
3097
3129
3098
3130
unstable_isNewReconciler: enableNewReconciler,
3099
3131
} ;
@@ -3253,6 +3285,12 @@ if (__DEV__) {
3253
3285
mountHookTypesDev ( ) ;
3254
3286
return mountOpaqueIdentifier ( ) ;
3255
3287
} ,
3288
+ useId(): string {
3289
+ currentHookNameInDev = 'useId' ;
3290
+ warnInvalidHookAccess ( ) ;
3291
+ mountHookTypesDev ( ) ;
3292
+ return mountId ( ) ;
3293
+ } ,
3256
3294
3257
3295
unstable_isNewReconciler: enableNewReconciler,
3258
3296
} ;
@@ -3412,6 +3450,12 @@ if (__DEV__) {
3412
3450
updateHookTypesDev ( ) ;
3413
3451
return updateOpaqueIdentifier ( ) ;
3414
3452
} ,
3453
+ useId(): string {
3454
+ currentHookNameInDev = 'useId' ;
3455
+ warnInvalidHookAccess ( ) ;
3456
+ updateHookTypesDev ( ) ;
3457
+ return updateId ( ) ;
3458
+ } ,
3415
3459
3416
3460
unstable_isNewReconciler: enableNewReconciler,
3417
3461
} ;
@@ -3572,6 +3616,12 @@ if (__DEV__) {
3572
3616
updateHookTypesDev ( ) ;
3573
3617
return rerenderOpaqueIdentifier ( ) ;
3574
3618
} ,
3619
+ useId(): string {
3620
+ currentHookNameInDev = 'useId' ;
3621
+ warnInvalidHookAccess ( ) ;
3622
+ updateHookTypesDev ( ) ;
3623
+ return updateId ( ) ;
3624
+ } ,
3575
3625
3576
3626
unstable_isNewReconciler: enableNewReconciler,
3577
3627
} ;
0 commit comments