@@ -1961,6 +1961,7 @@ function mountOptimistic<S, A>(
1961
1961
// This is different than the normal setState function.
1962
1962
const dispatch : A => void = ( dispatchOptimisticSetState . bind (
1963
1963
null ,
1964
+ 'setOptimistic()' ,
1964
1965
currentlyRenderingFiber ,
1965
1966
true ,
1966
1967
queue ,
@@ -2398,6 +2399,7 @@ function mountActionState<S, P>(
2398
2399
const pendingStateHook = mountStateImpl ( ( false : Thenable < boolean > | boolean ) ) ;
2399
2400
const setPendingState : boolean => void = ( dispatchOptimisticSetState . bind (
2400
2401
null ,
2402
+ 'useActionState()' ,
2401
2403
currentlyRenderingFiber ,
2402
2404
false ,
2403
2405
( ( pendingStateHook . queue : any ) : UpdateQueue <
@@ -3117,7 +3119,7 @@ function startTransition<S>(
3117
3119
// diverges; for example, both an optimistic update and this one should
3118
3120
// share the same lane.
3119
3121
ReactSharedInternals . T = currentTransition ;
3120
- dispatchOptimisticSetState ( fiber , false , queue , pendingState ) ;
3122
+ dispatchOptimisticSetState ( 'useTransition()' , fiber , false , queue , pendingState ) ;
3121
3123
3122
3124
try {
3123
3125
const returnValue = callback ( ) ;
@@ -3682,6 +3684,7 @@ function dispatchSetStateInternal<S, A>(
3682
3684
}
3683
3685
3684
3686
function dispatchOptimisticSetState < S , A > (
3687
+ label : string ,
3685
3688
fiber : Fiber ,
3686
3689
throwIfDuringRender : boolean ,
3687
3690
queue : UpdateQueue < S , A > ,
@@ -3766,7 +3769,7 @@ function dispatchOptimisticSetState<S, A>(
3766
3769
// will never be attempted before the optimistic update. This currently
3767
3770
// holds because the optimistic update is always synchronous. If we ever
3768
3771
// change that, we'll need to account for this.
3769
- startUpdateTimerByLane ( lane , 'setOptimistic()' ) ;
3772
+ startUpdateTimerByLane ( lane , label ) ;
3770
3773
scheduleUpdateOnFiber ( root , fiber , lane ) ;
3771
3774
// Optimistic updates are always synchronous, so we don't need to call
3772
3775
// entangleTransitionUpdate here.
0 commit comments