@@ -558,6 +558,7 @@ describe('ReactUse', () => {
558
558
}
559
559
} ) ;
560
560
561
+ // @gate !enableSiblingPrerendering
561
562
it ( 'during a transition, can unwrap async operations even if nothing is cached' , async ( ) => {
562
563
function App ( ) {
563
564
return < Text text = { use ( getAsyncText ( 'Async' ) ) } /> ;
@@ -593,6 +594,7 @@ describe('ReactUse', () => {
593
594
expect ( root ) . toMatchRenderedOutput ( 'Async' ) ;
594
595
} ) ;
595
596
597
+ // @gate !enableSiblingPrerendering
596
598
it ( "does not prevent a Suspense fallback from showing if it's a new boundary, even during a transition" , async ( ) => {
597
599
function App ( ) {
598
600
return < Text text = { use ( getAsyncText ( 'Async' ) ) } /> ;
@@ -635,6 +637,7 @@ describe('ReactUse', () => {
635
637
expect ( root ) . toMatchRenderedOutput ( 'Async' ) ;
636
638
} ) ;
637
639
640
+ // @gate !enableSiblingPrerendering
638
641
it ( 'when waiting for data to resolve, a fresh update will trigger a restart' , async ( ) => {
639
642
function App ( ) {
640
643
return < Text text = { use ( getAsyncText ( 'Will never resolve' ) ) } /> ;
@@ -666,6 +669,7 @@ describe('ReactUse', () => {
666
669
assertLog ( [ 'Something different' ] ) ;
667
670
} ) ;
668
671
672
+ // @gate !enableSiblingPrerendering
669
673
it ( 'when waiting for data to resolve, an update on a different root does not cause work to be dropped' , async ( ) => {
670
674
const promise = getAsyncText ( 'Hi' ) ;
671
675
@@ -708,6 +712,7 @@ describe('ReactUse', () => {
708
712
expect ( root1 ) . toMatchRenderedOutput ( 'Hi' ) ;
709
713
} ) ;
710
714
715
+ // @gate !enableSiblingPrerendering
711
716
it ( 'while suspended, hooks cannot be called (i.e. current dispatcher is unset correctly)' , async ( ) => {
712
717
function App ( ) {
713
718
return < Text text = { use ( getAsyncText ( 'Will never resolve' ) ) } /> ;
@@ -845,6 +850,7 @@ describe('ReactUse', () => {
845
850
expect ( root ) . toMatchRenderedOutput ( '(empty)' ) ;
846
851
} ) ;
847
852
853
+ // @gate !enableSiblingPrerendering
848
854
it ( 'when replaying a suspended component, reuses the hooks computed during the previous attempt (Memo)' , async ( ) => {
849
855
function ExcitingText ( { text} ) {
850
856
// This computes the uppercased version of some text. Pretend it's an
@@ -894,6 +900,7 @@ describe('ReactUse', () => {
894
900
] ) ;
895
901
} ) ;
896
902
903
+ // @gate !enableSiblingPrerendering
897
904
it ( 'when replaying a suspended component, reuses the hooks computed during the previous attempt (State)' , async ( ) => {
898
905
let _setFruit ;
899
906
let _setVegetable ;
@@ -950,6 +957,7 @@ describe('ReactUse', () => {
950
957
expect ( root ) . toMatchRenderedOutput ( 'banana dill' ) ;
951
958
} ) ;
952
959
960
+ // @gate !enableSiblingPrerendering
953
961
it ( 'when replaying a suspended component, reuses the hooks computed during the previous attempt (DebugValue+State)' , async ( ) => {
954
962
// Make sure we don't get a Hook mismatch warning on updates if there were non-stateful Hooks before the use().
955
963
let _setLawyer ;
@@ -991,6 +999,7 @@ describe('ReactUse', () => {
991
999
expect ( root ) . toMatchRenderedOutput ( 'aguacate avocat' ) ;
992
1000
} ) ;
993
1001
1002
+ // @gate !enableSiblingPrerendering
994
1003
it (
995
1004
'wrap an async function with useMemo to skip running the function ' +
996
1005
'twice when loading new data' ,
@@ -1073,6 +1082,7 @@ describe('ReactUse', () => {
1073
1082
expect ( root ) . toMatchRenderedOutput ( 'ABC' ) ;
1074
1083
} ) ;
1075
1084
1085
+ // @gate !enableSiblingPrerendering
1076
1086
it ( 'load multiple nested Suspense boundaries (uncached requests)' , async ( ) => {
1077
1087
// This the same as the previous test, except the requests are not cached.
1078
1088
// The tree should still eventually resolve, despite the
@@ -1196,6 +1206,7 @@ describe('ReactUse', () => {
1196
1206
expect ( root ) . toMatchRenderedOutput ( 'Hi' ) ;
1197
1207
} ) ;
1198
1208
1209
+ // @gate !enableSiblingPrerendering
1199
1210
it ( 'basic async component' , async ( ) => {
1200
1211
async function App ( ) {
1201
1212
await getAsyncText ( 'Hi' ) ;
@@ -1220,6 +1231,7 @@ describe('ReactUse', () => {
1220
1231
expect ( root ) . toMatchRenderedOutput ( 'Hi' ) ;
1221
1232
} ) ;
1222
1233
1234
+ // @gate !enableSiblingPrerendering
1223
1235
it ( 'async child of a non-function component (e.g. a class)' , async ( ) => {
1224
1236
class App extends React . Component {
1225
1237
async render ( ) {
0 commit comments