Monday, May 20, 2024
49
rated 0 times [  54] [ 5]  / answers: 1 / hits: 22533  / 8 Years ago, thu, may 12, 2016, 12:00:00

After upgrade to 0.26.0-rc version, this line:



React.findNodeHandle(this.refs.myRef)


Throws this error message:




Unhandled JS Exception: _react2.default.findNodeHandle is not a
function.




I'm importing React with this:



import React from 'react';


Docs still say:
As always, to obtain a native node handle for a component, you can use React.findNodeHandle(component).


More From » ecmascript-6

 Answers
13

Now the function may be used without object:



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


And call it directly:



findNodeHandle(this.refs[refName])

[#62199] Wednesday, May 11, 2016, 8 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
dezmondhumbertob

Total Points: 79
Total Questions: 112
Total Answers: 107

Location: Morocco
Member since Fri, May 22, 2020
4 Years ago
;