@@ -16,7 +16,7 @@ import type {
1616import type { Fiber , Dispatcher } from './ReactInternalTypes' ;
1717import type { Lanes , Lane } from './ReactFiberLane' ;
1818import type { HookEffectTag } from './ReactHookEffectTags' ;
19- import type { SuspenseConfig } from './ReactFiberSuspenseConfig ' ;
19+ import type { SuspenseConfig } from './ReactFiberTransition ' ;
2020import type { ReactPriorityLevel } from './ReactInternalTypes' ;
2121import type { FiberRoot } from './ReactInternalTypes' ;
2222import type { OpaqueIDType } from './ReactFiberHostConfig' ;
@@ -70,7 +70,6 @@ import invariant from 'shared/invariant';
7070import getComponentName from 'shared/getComponentName' ;
7171import is from 'shared/objectIs' ;
7272import { markWorkInProgressReceivedUpdate } from './ReactFiberBeginWork.new' ;
73- import { requestCurrentSuspenseConfig } from './ReactFiberSuspenseConfig' ;
7473import {
7574 UserBlockingPriority ,
7675 NormalPriority ,
@@ -1003,8 +1002,7 @@ function useMutableSource<Source, Snapshot>(
10031002 if ( ! is ( snapshot , maybeNewSnapshot ) ) {
10041003 setSnapshot ( maybeNewSnapshot ) ;
10051004
1006- const suspenseConfig = requestCurrentSuspenseConfig ( ) ;
1007- const lane = requestUpdateLane ( fiber , suspenseConfig ) ;
1005+ const lane = requestUpdateLane ( fiber ) ;
10081006 markRootMutableRead ( root , lane ) ;
10091007 }
10101008 // If the source mutated between render and now,
@@ -1024,8 +1022,7 @@ function useMutableSource<Source, Snapshot>(
10241022 latestSetSnapshot ( latestGetSnapshot ( source . _source ) ) ;
10251023
10261024 // 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 ) ;
10291026
10301027 markRootMutableRead ( root , lane ) ;
10311028 } catch ( error ) {
@@ -1441,12 +1438,12 @@ function mountDeferredValue<T>(
14411438): T {
14421439 const [ prevValue , setValue ] = mountState ( value ) ;
14431440 mountEffect ( ( ) => {
1444- const previousConfig = ReactCurrentBatchConfig . suspense ;
1445- ReactCurrentBatchConfig . suspense = config === undefined ? null : config ;
1441+ const prevTransition = ReactCurrentBatchConfig . transition ;
1442+ ReactCurrentBatchConfig . transition = 1 ;
14461443 try {
14471444 setValue ( value ) ;
14481445 } finally {
1449- ReactCurrentBatchConfig . suspense = previousConfig ;
1446+ ReactCurrentBatchConfig . transition = prevTransition ;
14501447 }
14511448 } , [ value , config ] ) ;
14521449 return prevValue ;
@@ -1458,12 +1455,12 @@ function updateDeferredValue<T>(
14581455): T {
14591456 const [ prevValue , setValue ] = updateState ( value ) ;
14601457 updateEffect ( ( ) => {
1461- const previousConfig = ReactCurrentBatchConfig . suspense ;
1462- ReactCurrentBatchConfig . suspense = config === undefined ? null : config ;
1458+ const prevTransition = ReactCurrentBatchConfig . transition ;
1459+ ReactCurrentBatchConfig . transition = 1 ;
14631460 try {
14641461 setValue ( value ) ;
14651462 } finally {
1466- ReactCurrentBatchConfig . suspense = previousConfig ;
1463+ ReactCurrentBatchConfig . transition = prevTransition ;
14671464 }
14681465 } , [ value , config ] ) ;
14691466 return prevValue ;
@@ -1475,12 +1472,12 @@ function rerenderDeferredValue<T>(
14751472): T {
14761473 const [ prevValue , setValue ] = rerenderState ( value ) ;
14771474 updateEffect ( ( ) => {
1478- const previousConfig = ReactCurrentBatchConfig . suspense ;
1479- ReactCurrentBatchConfig . suspense = config === undefined ? null : config ;
1475+ const prevTransition = ReactCurrentBatchConfig . transition ;
1476+ ReactCurrentBatchConfig . transition = 1 ;
14801477 try {
14811478 setValue ( value ) ;
14821479 } finally {
1483- ReactCurrentBatchConfig . suspense = previousConfig ;
1480+ ReactCurrentBatchConfig . transition = prevTransition ;
14841481 }
14851482 } , [ value , config ] ) ;
14861483 return prevValue ;
@@ -1509,16 +1506,16 @@ function startTransition(setPending, config, callback) {
15091506 runWithPriority (
15101507 priorityLevel > NormalPriority ? NormalPriority : priorityLevel ,
15111508 ( ) => {
1512- const previousConfig = ReactCurrentBatchConfig . suspense ;
1513- ReactCurrentBatchConfig . suspense = config === undefined ? null : config ;
1509+ const prevTransition = ReactCurrentBatchConfig . transition ;
1510+ ReactCurrentBatchConfig . transition = 1 ;
15141511 try {
15151512 setPending ( false ) ;
15161513 callback ( ) ;
15171514 } finally {
15181515 if ( decoupleUpdatePriorityFromScheduler ) {
15191516 setCurrentUpdateLanePriority ( previousLanePriority ) ;
15201517 }
1521- ReactCurrentBatchConfig . suspense = previousConfig ;
1518+ ReactCurrentBatchConfig . transition = prevTransition ;
15221519 }
15231520 } ,
15241521 ) ;
@@ -1535,13 +1532,13 @@ function startTransition(setPending, config, callback) {
15351532 runWithPriority (
15361533 priorityLevel > NormalPriority ? NormalPriority : priorityLevel ,
15371534 ( ) => {
1538- const previousConfig = ReactCurrentBatchConfig . suspense ;
1539- ReactCurrentBatchConfig . suspense = config === undefined ? null : config ;
1535+ const prevTransition = ReactCurrentBatchConfig . transition ;
1536+ ReactCurrentBatchConfig . transition = 1 ;
15401537 try {
15411538 setPending ( false ) ;
15421539 callback ( ) ;
15431540 } finally {
1544- ReactCurrentBatchConfig . suspense = previousConfig ;
1541+ ReactCurrentBatchConfig . transition = prevTransition ;
15451542 }
15461543 } ,
15471544 ) ;
@@ -1685,8 +1682,7 @@ function dispatchAction<S, A>(
16851682 }
16861683
16871684 const eventTime = requestEventTime ( ) ;
1688- const suspenseConfig = requestCurrentSuspenseConfig ( ) ;
1689- const lane = requestUpdateLane ( fiber , suspenseConfig ) ;
1685+ const lane = requestUpdateLane ( fiber ) ;
16901686
16911687 const update : Update < S , A > = {
16921688 lane ,
0 commit comments