@@ -558,6 +558,7 @@ describe('ReactUse', () => {
558558 }
559559 } ) ;
560560
561+ // @gate enableSuspendingDuringWorkLoop
561562 it ( 'during a transition, can unwrap async operations even if nothing is cached' , async ( ) => {
562563 function App ( ) {
563564 return < Text text = { use ( getAsyncText ( 'Async' ) ) } /> ;
@@ -593,6 +594,7 @@ describe('ReactUse', () => {
593594 expect ( root ) . toMatchRenderedOutput ( 'Async' ) ;
594595 } ) ;
595596
597+ // @gate enableSuspendingDuringWorkLoop
596598 it ( "does not prevent a Suspense fallback from showing if it's a new boundary, even during a transition" , async ( ) => {
597599 function App ( ) {
598600 return < Text text = { use ( getAsyncText ( 'Async' ) ) } /> ;
@@ -635,6 +637,7 @@ describe('ReactUse', () => {
635637 expect ( root ) . toMatchRenderedOutput ( 'Async' ) ;
636638 } ) ;
637639
640+ // @gate enableSuspendingDuringWorkLoop
638641 it ( 'when waiting for data to resolve, a fresh update will trigger a restart' , async ( ) => {
639642 function App ( ) {
640643 return < Text text = { use ( getAsyncText ( 'Will never resolve' ) ) } /> ;
@@ -666,6 +669,7 @@ describe('ReactUse', () => {
666669 assertLog ( [ 'Something different' ] ) ;
667670 } ) ;
668671
672+ // @gate enableSuspendingDuringWorkLoop
669673 it ( 'when waiting for data to resolve, an update on a different root does not cause work to be dropped' , async ( ) => {
670674 const promise = getAsyncText ( 'Hi' ) ;
671675
@@ -708,6 +712,7 @@ describe('ReactUse', () => {
708712 expect ( root1 ) . toMatchRenderedOutput ( 'Hi' ) ;
709713 } ) ;
710714
715+ // @gate enableSuspendingDuringWorkLoop
711716 it ( 'while suspended, hooks cannot be called (i.e. current dispatcher is unset correctly)' , async ( ) => {
712717 function App ( ) {
713718 return < Text text = { use ( getAsyncText ( 'Will never resolve' ) ) } /> ;
@@ -845,6 +850,7 @@ describe('ReactUse', () => {
845850 expect ( root ) . toMatchRenderedOutput ( '(empty)' ) ;
846851 } ) ;
847852
853+ // @gate enableSuspendingDuringWorkLoop
848854 it ( 'when replaying a suspended component, reuses the hooks computed during the previous attempt (Memo)' , async ( ) => {
849855 function ExcitingText ( { text} ) {
850856 // This computes the uppercased version of some text. Pretend it's an
@@ -894,6 +900,7 @@ describe('ReactUse', () => {
894900 ] ) ;
895901 } ) ;
896902
903+ // @gate enableSuspendingDuringWorkLoop
897904 it ( 'when replaying a suspended component, reuses the hooks computed during the previous attempt (State)' , async ( ) => {
898905 let _setFruit ;
899906 let _setVegetable ;
@@ -950,6 +957,7 @@ describe('ReactUse', () => {
950957 expect ( root ) . toMatchRenderedOutput ( 'banana dill' ) ;
951958 } ) ;
952959
960+ // @gate enableSuspendingDuringWorkLoop
953961 it ( 'when replaying a suspended component, reuses the hooks computed during the previous attempt (DebugValue+State)' , async ( ) => {
954962 // Make sure we don't get a Hook mismatch warning on updates if there were non-stateful Hooks before the use().
955963 let _setLawyer ;
@@ -991,6 +999,7 @@ describe('ReactUse', () => {
991999 expect ( root ) . toMatchRenderedOutput ( 'aguacate avocat' ) ;
9921000 } ) ;
9931001
1002+ // @gate enableSuspendingDuringWorkLoop
9941003 it (
9951004 'wrap an async function with useMemo to skip running the function ' +
9961005 'twice when loading new data' ,
@@ -1073,6 +1082,7 @@ describe('ReactUse', () => {
10731082 expect ( root ) . toMatchRenderedOutput ( 'ABC' ) ;
10741083 } ) ;
10751084
1085+ // @gate enableSuspendingDuringWorkLoop
10761086 it ( 'load multiple nested Suspense boundaries (uncached requests)' , async ( ) => {
10771087 // This the same as the previous test, except the requests are not cached.
10781088 // The tree should still eventually resolve, despite the
@@ -1196,6 +1206,7 @@ describe('ReactUse', () => {
11961206 expect ( root ) . toMatchRenderedOutput ( 'Hi' ) ;
11971207 } ) ;
11981208
1209+ // @gate enableSuspendingDuringWorkLoop
11991210 it ( 'basic async component' , async ( ) => {
12001211 async function App ( ) {
12011212 await getAsyncText ( 'Hi' ) ;
@@ -1220,6 +1231,7 @@ describe('ReactUse', () => {
12201231 expect ( root ) . toMatchRenderedOutput ( 'Hi' ) ;
12211232 } ) ;
12221233
1234+ // @gate enableSuspendingDuringWorkLoop
12231235 it ( 'async child of a non-function component (e.g. a class)' , async ( ) => {
12241236 class App extends React . Component {
12251237 async render ( ) {
0 commit comments