1010import type { Fiber } from './ReactFiber' ;
1111import type { Batch , FiberRoot } from './ReactFiberRoot' ;
1212import type { ExpirationTime } from './ReactFiberExpirationTime' ;
13- import type {
14- Interaction ,
15- InteractionsRef ,
16- SubscriberRef ,
17- } from 'schedule/src/Tracking' ;
13+ import type { Interaction } from 'schedule/src/Tracking' ;
1814
19- import { __getInteractionsRef , __getSubscriberRef } from 'schedule/tracking' ;
15+ import { __interactionsRef , __subscriberRef } from 'schedule/tracking' ;
2016import {
2117 invokeGuardedCallback ,
2218 hasCaughtError ,
@@ -166,13 +162,6 @@ export type Thenable = {
166162
167163const { ReactCurrentOwner} = ReactSharedInternals ;
168164
169- let interactionsRef : InteractionsRef = ( null : any ) ;
170- let subscriberRef : SubscriberRef = ( null : any ) ;
171- if ( enableSchedulerTracking ) {
172- interactionsRef = __getInteractionsRef ( ) ;
173- subscriberRef = __getSubscriberRef ( ) ;
174- }
175-
176165let didWarnAboutStateTransition ;
177166let didWarnSetStateChildContext ;
178167let warnAboutUpdateOnUnmounted ;
@@ -570,8 +559,8 @@ function commitRoot(root: FiberRoot, finishedWork: Fiber): void {
570559 if ( enableSchedulerTracking ) {
571560 // Restore any pending interactions at this point,
572561 // So that cascading work triggered during the render phase will be accounted for.
573- prevInteractions = interactionsRef . current ;
574- interactionsRef . current = root . memoizedInteractions ;
562+ prevInteractions = __interactionsRef . current ;
563+ __interactionsRef . current = root . memoizedInteractions ;
575564
576565 // We are potentially finished with the current batch of interactions.
577566 // So we should clear them out of the pending interaction map.
@@ -766,12 +755,12 @@ function commitRoot(root: FiberRoot, finishedWork: Fiber): void {
766755 onCommit ( root , earliestRemainingTimeAfterCommit ) ;
767756
768757 if ( enableSchedulerTracking ) {
769- interactionsRef . current = prevInteractions ;
758+ __interactionsRef . current = prevInteractions ;
770759
771760 let subscriber ;
772761
773762 try {
774- subscriber = subscriberRef . current ;
763+ subscriber = __subscriberRef . current ;
775764 if ( subscriber !== null && root . memoizedInteractions . size > 0 ) {
776765 const threadID = computeThreadID (
777766 committedExpirationTime ,
@@ -1176,8 +1165,8 @@ function renderRoot(
11761165 if ( enableSchedulerTracking ) {
11771166 // We're about to start new tracked work.
11781167 // Restore pending interactions so cascading work triggered during the render phase will be accounted for.
1179- prevInteractions = interactionsRef . current ;
1180- interactionsRef . current = root . memoizedInteractions ;
1168+ prevInteractions = __interactionsRef . current ;
1169+ __interactionsRef . current = root . memoizedInteractions ;
11811170 }
11821171
11831172 // Check if we're starting from a fresh stack, or if we're resuming from
@@ -1220,7 +1209,7 @@ function renderRoot(
12201209 root . memoizedInteractions = interactions ;
12211210
12221211 if ( interactions . size > 0 ) {
1223- const subscriber = subscriberRef . current ;
1212+ const subscriber = __subscriberRef . current ;
12241213 if ( subscriber !== null ) {
12251214 const threadID = computeThreadID (
12261215 expirationTime ,
@@ -1305,7 +1294,7 @@ function renderRoot(
13051294
13061295 if ( enableSchedulerTracking ) {
13071296 // Tracked work is done for now; restore the previous interactions.
1308- interactionsRef . current = prevInteractions ;
1297+ __interactionsRef . current = prevInteractions ;
13091298 }
13101299
13111300 // We're done performing work. Time to clean up.
@@ -1614,13 +1603,13 @@ function retrySuspendedRoot(
16141603 if ( rootExpirationTime !== NoWork ) {
16151604 if ( enableSchedulerTracking ) {
16161605 // Restore previous interactions so that new work is associated with them.
1617- let prevInteractions = interactionsRef . current ;
1618- interactionsRef . current = root . memoizedInteractions ;
1606+ let prevInteractions = __interactionsRef . current ;
1607+ __interactionsRef . current = root . memoizedInteractions ;
16191608 // Because suspense timeouts do not decrement the interaction count,
16201609 // Continued suspense work should also not increment the count.
16211610 storeInteractionsForExpirationTime ( root , rootExpirationTime , false ) ;
16221611 requestWork ( root , rootExpirationTime ) ;
1623- interactionsRef . current = prevInteractions ;
1612+ __interactionsRef . current = prevInteractions ;
16241613 } else {
16251614 requestWork ( root , rootExpirationTime ) ;
16261615 }
@@ -1687,7 +1676,7 @@ function storeInteractionsForExpirationTime(
16871676 return ;
16881677 }
16891678
1690- const interactions = interactionsRef . current ;
1679+ const interactions = __interactionsRef . current ;
16911680 if ( interactions . size > 0 ) {
16921681 const pendingInteractions = root . pendingInteractionMap . get ( expirationTime ) ;
16931682 if ( pendingInteractions != null ) {
@@ -1710,7 +1699,7 @@ function storeInteractionsForExpirationTime(
17101699 }
17111700 }
17121701
1713- const subscriber = subscriberRef . current ;
1702+ const subscriber = __subscriberRef . current ;
17141703 if ( subscriber !== null ) {
17151704 const threadID = computeThreadID (
17161705 expirationTime ,
0 commit comments