I just upgrade my react native app to 0.62.0, and now my app keeps getting this warning sign
ReactNativeFiberHostComponent: Calling `getNode()` on the ref of an Animated component
is no longer necessary. You can now directly use the ref instead.
This method will be removed in a future release.
I'm not sure why this issue is showing up? Can someone please explain?
I also see Stack
ref.getNode |
createAnimatedComponent.js:129:20
SafeView#_updateMeasurements | index.js:192:14
SafeView#componentDidUpdate | index.js:154:9
Update
I believe this might be coming from SafeAreaView from react-navigation
at line 192 change
this.view.getNode().measureInWindow((winX, winY, winWidth, winHeight)
to
this.view.measureInWindow((winX, winY, winWidth, winHeight)
I also came to this warning after upgraded ro RN 0.62.1, and I didn't use getNode()
at all, turns out it came from a depedencies that I use, called react-native-snap-carousel
because they build it with FlatList and possibly using the getNode()
as well.
And now there's an open issue about this in their GitHub repo that we can follow, here's the link to the issue
this also came from package react-native-safe-area-view
, possibly your app is using this package and now they have released new version to fix getNode()
deprecation, see this PR
so instead of fixing the file directly yourself, you just need to update the package, simply run: npm i react-native-safe-area-view
Hope that's help :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With