@@ -23,7 +23,7 @@ let useLayoutEffect;
2323let useCallback ;
2424let useMemo ;
2525let useRef ;
26- let useImperativeMethods ;
26+ let useImperativeHandle ;
2727let forwardRef ;
2828let flushPassiveEffects ;
2929let memo ;
@@ -71,7 +71,7 @@ describe('ReactHooksWithNoopRenderer', () => {
7171 useCallback = React . useCallback ;
7272 useMemo = React . useMemo ;
7373 useRef = React . useRef ;
74- useImperativeMethods = React . useImperativeMethods ;
74+ useImperativeHandle = React . useImperativeHandle ;
7575 forwardRef = React . forwardRef ;
7676 memo = React . memo ;
7777 } ) ;
@@ -88,7 +88,7 @@ describe('ReactHooksWithNoopRenderer', () => {
8888 it ( 'resumes after an interruption' , ( ) => {
8989 function Counter ( props , ref ) {
9090 const [ count , updateCount ] = useState ( 0 ) ;
91- useImperativeMethods ( ref , ( ) => ( { updateCount} ) ) ;
91+ useImperativeHandle ( ref , ( ) => ( { updateCount} ) ) ;
9292 return < Text text = { props . label + ': ' + count } /> ;
9393 }
9494 Counter = forwardRef ( Counter ) ;
@@ -172,7 +172,7 @@ describe('ReactHooksWithNoopRenderer', () => {
172172 it ( 'simple mount and update' , ( ) => {
173173 function Counter ( props , ref ) {
174174 const [ count , updateCount ] = useState ( 0 ) ;
175- useImperativeMethods ( ref , ( ) => ( { updateCount} ) ) ;
175+ useImperativeHandle ( ref , ( ) => ( { updateCount} ) ) ;
176176 return < Text text = { 'Count: ' + count } /> ;
177177 }
178178 Counter = forwardRef ( Counter ) ;
@@ -196,7 +196,7 @@ describe('ReactHooksWithNoopRenderer', () => {
196196 ReactNoop . yield ( 'getInitialState' ) ;
197197 return props . initialState ;
198198 } ) ;
199- useImperativeMethods ( ref , ( ) => ( { updateCount} ) ) ;
199+ useImperativeHandle ( ref , ( ) => ( { updateCount} ) ) ;
200200 return < Text text = { 'Count: ' + count } /> ;
201201 }
202202 Counter = forwardRef ( Counter ) ;
@@ -214,7 +214,7 @@ describe('ReactHooksWithNoopRenderer', () => {
214214 function Counter ( props , ref ) {
215215 const [ count , updateCount ] = useState ( 0 ) ;
216216 const [ label , updateLabel ] = useState ( 'Count' ) ;
217- useImperativeMethods ( ref , ( ) => ( { updateCount, updateLabel} ) ) ;
217+ useImperativeHandle ( ref , ( ) => ( { updateCount, updateLabel} ) ) ;
218218 return < Text text = { label + ': ' + count } /> ;
219219 }
220220 Counter = forwardRef ( Counter ) ;
@@ -444,7 +444,7 @@ describe('ReactHooksWithNoopRenderer', () => {
444444 function Counter ( { row : newRow } , ref ) {
445445 let [ reducer , setReducer ] = useState ( ( ) => reducerA ) ;
446446 let [ count , dispatch ] = useReducer ( reducer , 0 ) ;
447- useImperativeMethods ( ref , ( ) => ( { dispatch} ) ) ;
447+ useImperativeHandle ( ref , ( ) => ( { dispatch} ) ) ;
448448 if ( count < 20 ) {
449449 dispatch ( 'increment' ) ;
450450 // Swap reducers each time we increment
@@ -505,7 +505,7 @@ describe('ReactHooksWithNoopRenderer', () => {
505505
506506 function Counter ( props , ref ) {
507507 const [ count , dispatch ] = useReducer ( reducer , 0 ) ;
508- useImperativeMethods ( ref , ( ) => ( { dispatch} ) ) ;
508+ useImperativeHandle ( ref , ( ) => ( { dispatch} ) ) ;
509509 return < Text text = { 'Count: ' + count } /> ;
510510 }
511511 Counter = forwardRef ( Counter ) ;
@@ -546,7 +546,7 @@ describe('ReactHooksWithNoopRenderer', () => {
546546
547547 function Counter ( props , ref ) {
548548 const [ count , dispatch ] = useReducer ( reducer , 0 , initialAction ) ;
549- useImperativeMethods ( ref , ( ) => ( { dispatch} ) ) ;
549+ useImperativeHandle ( ref , ( ) => ( { dispatch} ) ) ;
550550 return < Text text = { 'Count: ' + count } /> ;
551551 }
552552 Counter = forwardRef ( Counter ) ;
@@ -576,7 +576,7 @@ describe('ReactHooksWithNoopRenderer', () => {
576576
577577 function Counter ( props , ref ) {
578578 const [ count , dispatch ] = useReducer ( reducer , 0 ) ;
579- useImperativeMethods ( ref , ( ) => ( { dispatch} ) ) ;
579+ useImperativeHandle ( ref , ( ) => ( { dispatch} ) ) ;
580580 return < Text text = { 'Count: ' + count } /> ;
581581 }
582582
0 commit comments