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