@@ -16,7 +16,7 @@ import type {
16
16
import type { Fiber , Dispatcher } from './ReactInternalTypes' ;
17
17
import type { Lanes , Lane } from './ReactFiberLane' ;
18
18
import type { HookEffectTag } from './ReactHookEffectTags' ;
19
- import type { SuspenseConfig } from './ReactFiberSuspenseConfig ' ;
19
+ import type { SuspenseConfig } from './ReactFiberTransition ' ;
20
20
import type { ReactPriorityLevel } from './ReactInternalTypes' ;
21
21
import type { FiberRoot } from './ReactInternalTypes' ;
22
22
import type { OpaqueIDType } from './ReactFiberHostConfig' ;
@@ -70,7 +70,6 @@ import invariant from 'shared/invariant';
70
70
import getComponentName from 'shared/getComponentName' ;
71
71
import is from 'shared/objectIs' ;
72
72
import { markWorkInProgressReceivedUpdate } from './ReactFiberBeginWork.new' ;
73
- import { requestCurrentSuspenseConfig } from './ReactFiberSuspenseConfig' ;
74
73
import {
75
74
UserBlockingPriority ,
76
75
NormalPriority ,
@@ -1003,8 +1002,7 @@ function useMutableSource<Source, Snapshot>(
1003
1002
if ( ! is ( snapshot , maybeNewSnapshot ) ) {
1004
1003
setSnapshot ( maybeNewSnapshot ) ;
1005
1004
1006
- const suspenseConfig = requestCurrentSuspenseConfig ( ) ;
1007
- const lane = requestUpdateLane ( fiber , suspenseConfig ) ;
1005
+ const lane = requestUpdateLane ( fiber ) ;
1008
1006
markRootMutableRead ( root , lane ) ;
1009
1007
}
1010
1008
// If the source mutated between render and now,
@@ -1024,8 +1022,7 @@ function useMutableSource<Source, Snapshot>(
1024
1022
latestSetSnapshot ( latestGetSnapshot ( source . _source ) ) ;
1025
1023
1026
1024
// Record a pending mutable source update with the same expiration time.
1027
- const suspenseConfig = requestCurrentSuspenseConfig ( ) ;
1028
- const lane = requestUpdateLane ( fiber , suspenseConfig ) ;
1025
+ const lane = requestUpdateLane ( fiber ) ;
1029
1026
1030
1027
markRootMutableRead ( root , lane ) ;
1031
1028
} catch ( error ) {
@@ -1441,12 +1438,12 @@ function mountDeferredValue<T>(
1441
1438
): T {
1442
1439
const [ prevValue , setValue ] = mountState ( value ) ;
1443
1440
mountEffect ( ( ) => {
1444
- const previousConfig = ReactCurrentBatchConfig . suspense ;
1445
- ReactCurrentBatchConfig . suspense = config === undefined ? null : config ;
1441
+ const prevTransition = ReactCurrentBatchConfig . transition ;
1442
+ ReactCurrentBatchConfig . transition = 1 ;
1446
1443
try {
1447
1444
setValue ( value ) ;
1448
1445
} finally {
1449
- ReactCurrentBatchConfig . suspense = previousConfig ;
1446
+ ReactCurrentBatchConfig . transition = prevTransition ;
1450
1447
}
1451
1448
} , [ value , config ] ) ;
1452
1449
return prevValue ;
@@ -1458,12 +1455,12 @@ function updateDeferredValue<T>(
1458
1455
): T {
1459
1456
const [ prevValue , setValue ] = updateState ( value ) ;
1460
1457
updateEffect ( ( ) => {
1461
- const previousConfig = ReactCurrentBatchConfig . suspense ;
1462
- ReactCurrentBatchConfig . suspense = config === undefined ? null : config ;
1458
+ const prevTransition = ReactCurrentBatchConfig . transition ;
1459
+ ReactCurrentBatchConfig . transition = 1 ;
1463
1460
try {
1464
1461
setValue ( value ) ;
1465
1462
} finally {
1466
- ReactCurrentBatchConfig . suspense = previousConfig ;
1463
+ ReactCurrentBatchConfig . transition = prevTransition ;
1467
1464
}
1468
1465
} , [ value , config ] ) ;
1469
1466
return prevValue ;
@@ -1475,12 +1472,12 @@ function rerenderDeferredValue<T>(
1475
1472
): T {
1476
1473
const [ prevValue , setValue ] = rerenderState ( value ) ;
1477
1474
updateEffect ( ( ) => {
1478
- const previousConfig = ReactCurrentBatchConfig . suspense ;
1479
- ReactCurrentBatchConfig . suspense = config === undefined ? null : config ;
1475
+ const prevTransition = ReactCurrentBatchConfig . transition ;
1476
+ ReactCurrentBatchConfig . transition = 1 ;
1480
1477
try {
1481
1478
setValue ( value ) ;
1482
1479
} finally {
1483
- ReactCurrentBatchConfig . suspense = previousConfig ;
1480
+ ReactCurrentBatchConfig . transition = prevTransition ;
1484
1481
}
1485
1482
} , [ value , config ] ) ;
1486
1483
return prevValue ;
@@ -1509,16 +1506,16 @@ function startTransition(setPending, config, callback) {
1509
1506
runWithPriority (
1510
1507
priorityLevel > NormalPriority ? NormalPriority : priorityLevel ,
1511
1508
( ) => {
1512
- const previousConfig = ReactCurrentBatchConfig . suspense ;
1513
- ReactCurrentBatchConfig . suspense = config === undefined ? null : config ;
1509
+ const prevTransition = ReactCurrentBatchConfig . transition ;
1510
+ ReactCurrentBatchConfig . transition = 1 ;
1514
1511
try {
1515
1512
setPending ( false ) ;
1516
1513
callback ( ) ;
1517
1514
} finally {
1518
1515
if ( decoupleUpdatePriorityFromScheduler ) {
1519
1516
setCurrentUpdateLanePriority ( previousLanePriority ) ;
1520
1517
}
1521
- ReactCurrentBatchConfig . suspense = previousConfig ;
1518
+ ReactCurrentBatchConfig . transition = prevTransition ;
1522
1519
}
1523
1520
} ,
1524
1521
) ;
@@ -1535,13 +1532,13 @@ function startTransition(setPending, config, callback) {
1535
1532
runWithPriority (
1536
1533
priorityLevel > NormalPriority ? NormalPriority : priorityLevel ,
1537
1534
( ) => {
1538
- const previousConfig = ReactCurrentBatchConfig . suspense ;
1539
- ReactCurrentBatchConfig . suspense = config === undefined ? null : config ;
1535
+ const prevTransition = ReactCurrentBatchConfig . transition ;
1536
+ ReactCurrentBatchConfig . transition = 1 ;
1540
1537
try {
1541
1538
setPending ( false ) ;
1542
1539
callback ( ) ;
1543
1540
} finally {
1544
- ReactCurrentBatchConfig . suspense = previousConfig ;
1541
+ ReactCurrentBatchConfig . transition = prevTransition ;
1545
1542
}
1546
1543
} ,
1547
1544
) ;
@@ -1685,8 +1682,7 @@ function dispatchAction<S, A>(
1685
1682
}
1686
1683
1687
1684
const eventTime = requestEventTime ( ) ;
1688
- const suspenseConfig = requestCurrentSuspenseConfig ( ) ;
1689
- const lane = requestUpdateLane ( fiber , suspenseConfig ) ;
1685
+ const lane = requestUpdateLane ( fiber ) ;
1690
1686
1691
1687
const update : Update < S , A > = {
1692
1688
lane ,
0 commit comments