Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Undefined is not a function(React.findNodehandle)

Tags:

react-native

I upgraded ReactNative from 0.2.1 to 0.26.3 and then ran the project on both Android and iOS. It worked fine in iOS but in Android, it throw out an error :

Undefined is not a function(React.defalut2.findNodehandle)

Also tried {import ReactNative, {} from 'react-native';} and ReactNative.findNodeHandle(component) ; it did not work neither.

like image 695
crazylazy420 Avatar asked Dec 08 '22 22:12

crazylazy420


1 Answers

You can now import the function directly:

import {
  ...
  findNodeHandle,
  ...
} from 'react-native';

And use without class:

 findNodeHandle(ref)
like image 88
igor Avatar answered Dec 11 '22 08:12

igor