@@ -209,7 +209,7 @@ describe('ReactOffscreen', () => {
209
209
) ;
210
210
} ) ;
211
211
212
- // @gate enableOffscreen
212
+ // @gate enableActivity
213
213
it ( 'mounts without layout effects when hidden' , async ( ) => {
214
214
function Child ( { text} ) {
215
215
useLayoutEffect ( ( ) => {
@@ -247,7 +247,7 @@ describe('ReactOffscreen', () => {
247
247
expect ( root ) . toMatchRenderedOutput ( < span prop = "Child" /> ) ;
248
248
} ) ;
249
249
250
- // @gate enableOffscreen
250
+ // @gate enableActivity
251
251
it ( 'mounts/unmounts layout effects when visibility changes (starting visible)' , async ( ) => {
252
252
function Child ( { text} ) {
253
253
useLayoutEffect ( ( ) => {
@@ -293,7 +293,7 @@ describe('ReactOffscreen', () => {
293
293
expect ( root ) . toMatchRenderedOutput ( < span prop = "Child" /> ) ;
294
294
} ) ;
295
295
296
- // @gate enableOffscreen
296
+ // @gate enableActivity
297
297
it ( 'nested offscreen does not call componentWillUnmount when hidden' , async ( ) => {
298
298
// This is a bug that appeared during production test of <unstable_Activity />.
299
299
// It is a very specific scenario with nested Offscreens. The inner offscreen
@@ -397,7 +397,7 @@ describe('ReactOffscreen', () => {
397
397
assertLog ( [ 'child' ] ) ;
398
398
} ) ;
399
399
400
- // @gate enableOffscreen
400
+ // @gate enableActivity
401
401
it ( 'mounts/unmounts layout effects when visibility changes (starting hidden)' , async ( ) => {
402
402
function Child ( { text} ) {
403
403
useLayoutEffect ( ( ) => {
@@ -444,7 +444,7 @@ describe('ReactOffscreen', () => {
444
444
expect ( root ) . toMatchRenderedOutput ( < span hidden = { true } prop = "Child" /> ) ;
445
445
} ) ;
446
446
447
- // @gate enableOffscreen
447
+ // @gate enableActivity
448
448
it ( 'hides children of offscreen after layout effects are destroyed' , async ( ) => {
449
449
const root = ReactNoop . createRoot ( ) ;
450
450
function Child ( { text} ) {
@@ -531,7 +531,7 @@ describe('ReactOffscreen', () => {
531
531
assertLog ( [ 'Unmount layout' ] ) ;
532
532
} ) ;
533
533
534
- // @gate enableOffscreen
534
+ // @gate enableActivity
535
535
it ( 'hides new insertions into an already hidden tree' , async ( ) => {
536
536
const root = ReactNoop . createRoot ( ) ;
537
537
await act ( ( ) => {
@@ -561,7 +561,7 @@ describe('ReactOffscreen', () => {
561
561
) ;
562
562
} ) ;
563
563
564
- // @gate enableOffscreen
564
+ // @gate enableActivity
565
565
it ( 'hides updated nodes inside an already hidden tree' , async ( ) => {
566
566
const root = ReactNoop . createRoot ( ) ;
567
567
await act ( ( ) => {
@@ -607,7 +607,7 @@ describe('ReactOffscreen', () => {
607
607
expect ( root ) . toMatchRenderedOutput ( < span > Hi</ span > ) ;
608
608
} ) ;
609
609
610
- // @gate enableOffscreen
610
+ // @gate enableActivity
611
611
it ( 'revealing a hidden tree at high priority does not cause tearing' , async ( ) => {
612
612
// When revealing an offscreen tree, we need to include updates that were
613
613
// previously deferred because the tree was hidden, even if they are lower
@@ -741,7 +741,7 @@ describe('ReactOffscreen', () => {
741
741
expect ( areOuterAndInnerConsistent ( ) ) . toBe ( true ) ;
742
742
} ) ;
743
743
744
- // @gate enableOffscreen
744
+ // @gate enableActivity
745
745
it ( 'regression: Activity instance is sometimes null during setState' , async ( ) => {
746
746
let setState ;
747
747
function Child ( ) {
@@ -789,7 +789,7 @@ describe('ReactOffscreen', () => {
789
789
expect ( root ) . toMatchRenderedOutput ( null ) ;
790
790
} ) ;
791
791
792
- // @gate enableOffscreen
792
+ // @gate enableActivity
793
793
it ( 'class component setState callbacks do not fire until tree is visible' , async ( ) => {
794
794
const root = ReactNoop . createRoot ( ) ;
795
795
@@ -841,7 +841,7 @@ describe('ReactOffscreen', () => {
841
841
expect ( root ) . toMatchRenderedOutput ( < span prop = "C" /> ) ;
842
842
} ) ;
843
843
844
- // @gate enableOffscreen
844
+ // @gate enableActivity
845
845
it ( 'does not call componentDidUpdate when reappearing a hidden class component' , async ( ) => {
846
846
class Child extends React . Component {
847
847
componentDidMount ( ) {
@@ -891,7 +891,7 @@ describe('ReactOffscreen', () => {
891
891
assertLog ( [ 'componentDidMount' ] ) ;
892
892
} ) ;
893
893
894
- // @gate enableOffscreen
894
+ // @gate enableActivity
895
895
it (
896
896
'when reusing old components (hidden -> visible), layout effects fire ' +
897
897
'with same timing as if it were brand new' ,
@@ -944,7 +944,7 @@ describe('ReactOffscreen', () => {
944
944
} ,
945
945
) ;
946
946
947
- // @gate enableOffscreen
947
+ // @gate enableActivity
948
948
it (
949
949
'when reusing old components (hidden -> visible), layout effects fire ' +
950
950
'with same timing as if it were brand new (includes setState callback)' ,
@@ -1007,7 +1007,7 @@ describe('ReactOffscreen', () => {
1007
1007
} ,
1008
1008
) ;
1009
1009
1010
- // @gate enableOffscreen
1010
+ // @gate enableActivity
1011
1011
it ( 'defer passive effects when prerendering a new Activity tree' , async ( ) => {
1012
1012
function Child ( { label} ) {
1013
1013
useEffect ( ( ) => {
@@ -1125,7 +1125,7 @@ describe('ReactOffscreen', () => {
1125
1125
assertLog ( [ 'Shell' , 'More' ] ) ;
1126
1126
} ) ;
1127
1127
1128
- // @gate enableOffscreen
1128
+ // @gate enableActivity
1129
1129
it ( 'passive effects are connected and disconnected when the visibility changes' , async ( ) => {
1130
1130
function Child ( { step} ) {
1131
1131
useEffect ( ( ) => {
@@ -1182,7 +1182,7 @@ describe('ReactOffscreen', () => {
1182
1182
expect ( root ) . toMatchRenderedOutput ( < span prop = { 2 } /> ) ;
1183
1183
} ) ;
1184
1184
1185
- // @gate enableOffscreen
1185
+ // @gate enableActivity
1186
1186
it ( 'passive effects are unmounted on hide in the same order as during a deletion: parent before child' , async ( ) => {
1187
1187
function Child ( { label} ) {
1188
1188
useEffect ( ( ) => {
@@ -1240,7 +1240,7 @@ describe('ReactOffscreen', () => {
1240
1240
// Re-enable this test once we add this ability. For example, we'll likely add
1241
1241
// either an option or a heuristic to mount passive effects inside a hidden
1242
1242
// tree after a delay.
1243
- // @gate enableOffscreen
1243
+ // @gate enableActivity
1244
1244
it . skip ( "don't defer passive effects when prerendering in a tree whose effects are already connected" , async ( ) => {
1245
1245
function Child ( { label} ) {
1246
1246
useEffect ( ( ) => {
@@ -1296,7 +1296,7 @@ describe('ReactOffscreen', () => {
1296
1296
] ) ;
1297
1297
} ) ;
1298
1298
1299
- // @gate enableOffscreen
1299
+ // @gate enableActivity
1300
1300
it ( 'does not mount effects when prerendering a nested Activity boundary' , async ( ) => {
1301
1301
function Child ( { label} ) {
1302
1302
useEffect ( ( ) => {
@@ -1374,7 +1374,7 @@ describe('ReactOffscreen', () => {
1374
1374
) ;
1375
1375
} ) ;
1376
1376
1377
- // @gate enableOffscreen
1377
+ // @gate enableActivity
1378
1378
it ( 'reveal an outer Activity boundary without revealing an inner one' , async ( ) => {
1379
1379
function Child ( { label} ) {
1380
1380
useEffect ( ( ) => {
@@ -1441,7 +1441,7 @@ describe('ReactOffscreen', () => {
1441
1441
} ) ;
1442
1442
1443
1443
describe ( 'manual interactivity' , ( ) => {
1444
- // @gate enableOffscreen
1444
+ // @gate enableActivity
1445
1445
it ( 'should attach ref only for mode null' , async ( ) => {
1446
1446
let offscreenRef ;
1447
1447
@@ -1485,7 +1485,7 @@ describe('ReactOffscreen', () => {
1485
1485
expect ( offscreenRef . current ) . not . toBeNull ( ) ;
1486
1486
} ) ;
1487
1487
1488
- // @gate enableOffscreen
1488
+ // @gate enableActivity
1489
1489
it ( 'should lower update priority for detached Activity' , async ( ) => {
1490
1490
let updateChildState ;
1491
1491
let updateHighPriorityComponentState ;
@@ -1595,7 +1595,7 @@ describe('ReactOffscreen', () => {
1595
1595
} ) ;
1596
1596
} ) ;
1597
1597
1598
- // @gate enableOffscreen
1598
+ // @gate enableActivity
1599
1599
it ( 'defers detachment if called during commit' , async ( ) => {
1600
1600
let updateChildState ;
1601
1601
let updateHighPriorityComponentState ;
@@ -1702,7 +1702,7 @@ describe('ReactOffscreen', () => {
1702
1702
} ) ;
1703
1703
} ) ;
1704
1704
1705
- // @gate enableOffscreen
1705
+ // @gate enableActivity
1706
1706
it ( 'should detach ref if Activity is unmounted' , async ( ) => {
1707
1707
let offscreenRef ;
1708
1708
@@ -1740,7 +1740,7 @@ describe('ReactOffscreen', () => {
1740
1740
expect ( offscreenRef . current ) . not . toBeNull ( ) ;
1741
1741
} ) ;
1742
1742
1743
- // @gate enableOffscreen
1743
+ // @gate enableActivity
1744
1744
it ( 'should detach ref when parent Activity is hidden' , async ( ) => {
1745
1745
let offscreenRef ;
1746
1746
@@ -1775,7 +1775,7 @@ describe('ReactOffscreen', () => {
1775
1775
expect ( offscreenRef . current ) . toBeNull ( ) ;
1776
1776
} ) ;
1777
1777
1778
- // @gate enableOffscreen
1778
+ // @gate enableActivity
1779
1779
it ( 'should change _current' , async ( ) => {
1780
1780
let offscreenRef ;
1781
1781
const root = ReactNoop . createRoot ( ) ;
@@ -1811,7 +1811,7 @@ describe('ReactOffscreen', () => {
1811
1811
expect ( offscreenRef . current . _current === firstFiber ) . toBeFalsy ( ) ;
1812
1812
} ) ;
1813
1813
1814
- // @gate enableOffscreen
1814
+ // @gate enableActivity
1815
1815
it ( 'does not mount tree until attach is called' , async ( ) => {
1816
1816
let offscreenRef ;
1817
1817
let spanRef ;
@@ -1879,7 +1879,7 @@ describe('ReactOffscreen', () => {
1879
1879
assertLog ( [ ] ) ;
1880
1880
} ) ;
1881
1881
1882
- // @gate enableOffscreen
1882
+ // @gate enableActivity
1883
1883
it ( 'handles nested manual offscreens' , async ( ) => {
1884
1884
let outerOffscreen ;
1885
1885
let innerOffscreen ;
@@ -1970,7 +1970,7 @@ describe('ReactOffscreen', () => {
1970
1970
assertLog ( [ 'unmount layout inner' , 'unmount inner' ] ) ;
1971
1971
} ) ;
1972
1972
1973
- // @gate enableOffscreen
1973
+ // @gate enableActivity
1974
1974
it ( 'batches multiple attach and detach calls scheduled from an event handler' , async ( ) => {
1975
1975
function Child ( ) {
1976
1976
useEffect ( ( ) => {
@@ -2024,7 +2024,7 @@ describe('ReactOffscreen', () => {
2024
2024
assertLog ( [ ] ) ;
2025
2025
} ) ;
2026
2026
2027
- // @gate enableOffscreen
2027
+ // @gate enableActivity
2028
2028
it ( 'batches multiple attach and detach calls scheduled from an effect' , async ( ) => {
2029
2029
function Child ( ) {
2030
2030
useEffect ( ( ) => {
0 commit comments