@@ -366,10 +366,9 @@ describe('ReactHooksInspectionIntegration', () => {
366
366
] ) ;
367
367
} ) ;
368
368
369
- // @gate experimental
370
369
it ( 'should support composite useTransition hook' , ( ) => {
371
370
function Foo ( props ) {
372
- React . unstable_useTransition ( ) ;
371
+ React . useTransition ( ) ;
373
372
const memoizedValue = React . useMemo ( ( ) => 'hello' , [ ] ) ;
374
373
return < div > { memoizedValue } </ div > ;
375
374
}
@@ -394,10 +393,9 @@ describe('ReactHooksInspectionIntegration', () => {
394
393
] ) ;
395
394
} ) ;
396
395
397
- // @gate experimental
398
396
it ( 'should support composite useDeferredValue hook' , ( ) => {
399
397
function Foo ( props ) {
400
- React . unstable_useDeferredValue ( 'abc' , {
398
+ React . useDeferredValue ( 'abc' , {
401
399
timeoutMs : 500 ,
402
400
} ) ;
403
401
const [ state ] = React . useState ( ( ) => 'hello' , [ ] ) ;
@@ -424,7 +422,6 @@ describe('ReactHooksInspectionIntegration', () => {
424
422
] ) ;
425
423
} ) ;
426
424
427
- // @gate experimental
428
425
it ( 'should support composite useOpaqueIdentifier hook' , ( ) => {
429
426
function Foo ( props ) {
430
427
const id = React . unstable_useOpaqueIdentifier ( ) ;
@@ -452,7 +449,6 @@ describe('ReactHooksInspectionIntegration', () => {
452
449
} ) ;
453
450
} ) ;
454
451
455
- // @gate experimental
456
452
it ( 'should support composite useOpaqueIdentifier hook in concurrent mode' , ( ) => {
457
453
function Foo ( props ) {
458
454
const id = React . unstable_useOpaqueIdentifier ( ) ;
@@ -846,37 +842,40 @@ describe('ReactHooksInspectionIntegration', () => {
846
842
] ) ;
847
843
} ) ;
848
844
849
- if ( __EXPERIMENTAL__ ) {
850
- it ( 'should support composite useMutableSource hook' , ( ) => {
851
- const mutableSource = React . unstable_createMutableSource ( { } , ( ) => 1 ) ;
852
- function Foo ( props ) {
853
- React . unstable_useMutableSource (
854
- mutableSource ,
855
- ( ) => 'snapshot' ,
856
- ( ) => { } ,
857
- ) ;
858
- React . useMemo ( ( ) => 'memo' , [ ] ) ;
859
- return < div /> ;
860
- }
861
- const renderer = ReactTestRenderer . create ( < Foo /> ) ;
862
- const childFiber = renderer . root . findByType ( Foo ) . _currentFiber ( ) ;
863
- const tree = ReactDebugTools . inspectHooksOfFiber ( childFiber ) ;
864
- expect ( tree ) . toEqual ( [
865
- {
866
- id : 0 ,
867
- isStateEditable : false ,
868
- name : 'MutableSource' ,
869
- value : 'snapshot' ,
870
- subHooks : [ ] ,
871
- } ,
872
- {
873
- id : 1 ,
874
- isStateEditable : false ,
875
- name : 'Memo' ,
876
- value : 'memo' ,
877
- subHooks : [ ] ,
878
- } ,
879
- ] ) ;
880
- } ) ;
881
- }
845
+ it ( 'should support composite useMutableSource hook' , ( ) => {
846
+ const createMutableSource =
847
+ React . createMutableSource || React . unstable_createMutableSource ;
848
+ const useMutableSource =
849
+ React . useMutableSource || React . unstable_useMutableSource ;
850
+
851
+ const mutableSource = createMutableSource ( { } , ( ) => 1 ) ;
852
+ function Foo ( props ) {
853
+ useMutableSource (
854
+ mutableSource ,
855
+ ( ) => 'snapshot' ,
856
+ ( ) => { } ,
857
+ ) ;
858
+ React . useMemo ( ( ) => 'memo' , [ ] ) ;
859
+ return < div /> ;
860
+ }
861
+ const renderer = ReactTestRenderer . create ( < Foo /> ) ;
862
+ const childFiber = renderer . root . findByType ( Foo ) . _currentFiber ( ) ;
863
+ const tree = ReactDebugTools . inspectHooksOfFiber ( childFiber ) ;
864
+ expect ( tree ) . toEqual ( [
865
+ {
866
+ id : 0 ,
867
+ isStateEditable : false ,
868
+ name : 'MutableSource' ,
869
+ value : 'snapshot' ,
870
+ subHooks : [ ] ,
871
+ } ,
872
+ {
873
+ id : 1 ,
874
+ isStateEditable : false ,
875
+ name : 'Memo' ,
876
+ value : 'memo' ,
877
+ subHooks : [ ] ,
878
+ } ,
879
+ ] ) ;
880
+ } ) ;
882
881
} ) ;
0 commit comments