@@ -546,6 +546,7 @@ describe('ReactHooksInspectionIntegration', () => {
546546 function Foo ( props ) {
547547 React . useTransition ( ) ;
548548 const memoizedValue = React . useMemo ( ( ) => 'hello' , [ ] ) ;
549+ React . useMemo ( ( ) => 'not used' , [ ] ) ;
549550 return < div > { memoizedValue } </ div > ;
550551 }
551552 const renderer = ReactTestRenderer . create ( < Foo /> ) ;
@@ -566,16 +567,24 @@ describe('ReactHooksInspectionIntegration', () => {
566567 value : 'hello' ,
567568 subHooks : [ ] ,
568569 } ,
570+ {
571+ id : 2 ,
572+ isStateEditable : false ,
573+ name : 'Memo' ,
574+ value : 'not used' ,
575+ subHooks : [ ] ,
576+ } ,
569577 ] ) ;
570578 } ) ;
571579
572- it ( 'should support composite useDeferredValue hook' , ( ) => {
580+ it ( 'should support useDeferredValue hook' , ( ) => {
573581 function Foo ( props ) {
574582 React . useDeferredValue ( 'abc' , {
575583 timeoutMs : 500 ,
576584 } ) ;
577- const [ state ] = React . useState ( ( ) => 'hello' , [ ] ) ;
578- return < div > { state } </ div > ;
585+ const memoizedValue = React . useMemo ( ( ) => 1 , [ ] ) ;
586+ React . useMemo ( ( ) => 2 , [ ] ) ;
587+ return < div > { memoizedValue } </ div > ;
579588 }
580589 const renderer = ReactTestRenderer . create ( < Foo /> ) ;
581590 const childFiber = renderer . root . findByType ( Foo ) . _currentFiber ( ) ;
@@ -590,9 +599,16 @@ describe('ReactHooksInspectionIntegration', () => {
590599 } ,
591600 {
592601 id : 1 ,
593- isStateEditable : true ,
594- name : 'State' ,
595- value : 'hello' ,
602+ isStateEditable : false ,
603+ name : 'Memo' ,
604+ value : 1 ,
605+ subHooks : [ ] ,
606+ } ,
607+ {
608+ id : 2 ,
609+ isStateEditable : false ,
610+ name : 'Memo' ,
611+ value : 2 ,
596612 subHooks : [ ] ,
597613 } ,
598614 ] ) ;
@@ -1012,6 +1028,7 @@ describe('ReactHooksInspectionIntegration', () => {
10121028 ( ) => { } ,
10131029 ) ;
10141030 React . useMemo ( ( ) => 'memo' , [ ] ) ;
1031+ React . useMemo ( ( ) => 'not used' , [ ] ) ;
10151032 return < div /> ;
10161033 }
10171034 const renderer = ReactTestRenderer . create ( < Foo /> ) ;
@@ -1032,6 +1049,13 @@ describe('ReactHooksInspectionIntegration', () => {
10321049 value : 'memo' ,
10331050 subHooks : [ ] ,
10341051 } ,
1052+ {
1053+ id : 2 ,
1054+ isStateEditable : false ,
1055+ name : 'Memo' ,
1056+ value : 'not used' ,
1057+ subHooks : [ ] ,
1058+ } ,
10351059 ] ) ;
10361060 } ) ;
10371061
@@ -1043,6 +1067,7 @@ describe('ReactHooksInspectionIntegration', () => {
10431067 ( ) => 'snapshot' ,
10441068 ) ;
10451069 React . useMemo ( ( ) => 'memo' , [ ] ) ;
1070+ React . useMemo ( ( ) => 'not used' , [ ] ) ;
10461071 return value ;
10471072 }
10481073
@@ -1064,6 +1089,13 @@ describe('ReactHooksInspectionIntegration', () => {
10641089 value : 'memo' ,
10651090 subHooks : [ ] ,
10661091 } ,
1092+ {
1093+ id : 2 ,
1094+ isStateEditable : false ,
1095+ name : 'Memo' ,
1096+ value : 'not used' ,
1097+ subHooks : [ ] ,
1098+ } ,
10671099 ] ) ;
10681100 } ) ;
10691101} ) ;
0 commit comments