4

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.

IAmInPLS
  • 4,051
  • 4
  • 24
  • 57
crazylazy420
  • 61
  • 1
  • 3

1 Answers1

14

You can now import the function directly:

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

And use without class:

 findNodeHandle(ref)
igor
  • 871
  • 6
  • 4