@@ -96,9 +96,6 @@ describe('Shared useSyncExternalStore behavior (shim and built-in)', () => {
96
96
} ;
97
97
}
98
98
99
- // 18 has an experimental flag to warn about reading refs. Will circumvent
100
- // when built-in API is implemented.
101
- // @gate !enableUseRefAccessWarning || !__DEV__
102
99
test ( 'basic usage' , ( ) => {
103
100
const store = createExternalStore ( 'Initial' ) ;
104
101
@@ -141,9 +138,6 @@ describe('Shared useSyncExternalStore behavior (shim and built-in)', () => {
141
138
expect ( root ) . toMatchRenderedOutput ( 'Initial' ) ;
142
139
} ) ;
143
140
144
- // 18 has an experimental flag to warn about reading refs. Will circumvent
145
- // when built-in API is implemented.
146
- // @gate !enableUseRefAccessWarning || !__DEV__
147
141
test ( 'switch to a different store' , ( ) => {
148
142
const storeA = createExternalStore ( 0 ) ;
149
143
const storeB = createExternalStore ( 0 ) ;
@@ -193,9 +187,6 @@ describe('Shared useSyncExternalStore behavior (shim and built-in)', () => {
193
187
expect ( root ) . toMatchRenderedOutput ( '1' ) ;
194
188
} ) ;
195
189
196
- // 18 has an experimental flag to warn about reading refs. Will circumvent
197
- // when built-in API is implemented.
198
- // @gate !enableUseRefAccessWarning || !__DEV__
199
190
test ( 'selecting a specific value inside getSnapshot' , ( ) => {
200
191
const store = createExternalStore ( { a : 0 , b : 0 } ) ;
201
192
@@ -239,9 +230,6 @@ describe('Shared useSyncExternalStore behavior (shim and built-in)', () => {
239
230
expect ( root ) . toMatchRenderedOutput ( 'A1B1' ) ;
240
231
} ) ;
241
232
242
- // 18 has an experimental flag to warn about reading refs. Will circumvent
243
- // when built-in API is implemented.
244
- // @gate !enableUseRefAccessWarning || !__DEV__
245
233
test (
246
234
"compares to current state before bailing out, even when there's a " +
247
235
'mutation in between the sync and passive effects' ,
@@ -284,9 +272,6 @@ describe('Shared useSyncExternalStore behavior (shim and built-in)', () => {
284
272
} ,
285
273
) ;
286
274
287
- // 18 has an experimental flag to warn about reading refs. Will circumvent
288
- // when built-in API is implemented.
289
- // @gate !enableUseRefAccessWarning || !__DEV__
290
275
test ( 'mutating the store in between render and commit when getSnapshot has changed' , ( ) => {
291
276
const store = createExternalStore ( { a : 1 , b : 1 } ) ;
292
277
@@ -345,9 +330,6 @@ describe('Shared useSyncExternalStore behavior (shim and built-in)', () => {
345
330
expect ( root ) . toMatchRenderedOutput ( 'B2' ) ;
346
331
} ) ;
347
332
348
- // 18 has an experimental flag to warn about reading refs. Will circumvent
349
- // when built-in API is implemented.
350
- // @gate !enableUseRefAccessWarning || !__DEV__
351
333
test ( 'mutating the store in between render and commit when getSnapshot has _not_ changed' , ( ) => {
352
334
// Same as previous test, but `getSnapshot` does not change
353
335
const store = createExternalStore ( { a : 1 , b : 1 } ) ;
@@ -405,9 +387,6 @@ describe('Shared useSyncExternalStore behavior (shim and built-in)', () => {
405
387
expect ( root ) . toMatchRenderedOutput ( 'A1' ) ;
406
388
} ) ;
407
389
408
- // 18 has an experimental flag to warn about reading refs. Will circumvent
409
- // when built-in API is implemented.
410
- // @gate !enableUseRefAccessWarning || !__DEV__
411
390
test ( "does not bail out if the previous update hasn't finished yet" , ( ) => {
412
391
const store = createExternalStore ( 0 ) ;
413
392
@@ -443,9 +422,6 @@ describe('Shared useSyncExternalStore behavior (shim and built-in)', () => {
443
422
expect ( root ) . toMatchRenderedOutput ( '00' ) ;
444
423
} ) ;
445
424
446
- // 18 has an experimental flag to warn about reading refs. Will circumvent
447
- // when built-in API is implemented.
448
- // @gate !enableUseRefAccessWarning || !__DEV__
449
425
test ( 'uses the latest getSnapshot, even if it changed in the same batch as a store update' , ( ) => {
450
426
const store = createExternalStore ( { a : 0 , b : 0 } ) ;
451
427
@@ -473,9 +449,6 @@ describe('Shared useSyncExternalStore behavior (shim and built-in)', () => {
473
449
expect ( root ) . toMatchRenderedOutput ( '2' ) ;
474
450
} ) ;
475
451
476
- // 18 has an experimental flag to warn about reading refs. Will circumvent
477
- // when built-in API is implemented.
478
- // @gate !enableUseRefAccessWarning || !__DEV__
479
452
test ( 'handles errors thrown by getSnapshot or isEqual' , ( ) => {
480
453
class ErrorBoundary extends React . Component {
481
454
state = { error : null } ;
@@ -552,9 +525,6 @@ describe('Shared useSyncExternalStore behavior (shim and built-in)', () => {
552
525
} ) ;
553
526
554
527
describe ( 'extra features implemented in user-space' , ( ) => {
555
- // 18 has an experimental flag to warn about reading refs. Will circumvent
556
- // when built-in API is implemented.
557
- // @gate !enableUseRefAccessWarning || !__DEV__
558
528
test ( 'memoized selectors are only called once per update' , ( ) => {
559
529
const store = createExternalStore ( { a : 0 , b : 0 } ) ;
560
530
@@ -593,9 +563,6 @@ describe('Shared useSyncExternalStore behavior (shim and built-in)', () => {
593
563
expect ( root ) . toMatchRenderedOutput ( 'A1' ) ;
594
564
} ) ;
595
565
596
- // 18 has an experimental flag to warn about reading refs. Will circumvent
597
- // when built-in API is implemented.
598
- // @gate !enableUseRefAccessWarning || !__DEV__
599
566
test ( 'Using isEqual to bailout' , ( ) => {
600
567
const store = createExternalStore ( { a : 0 , b : 0 } ) ;
601
568
0 commit comments