已升级到React Native 0.62.0,得到警告信号-“不再需要在Animated组件的ref上调用`getNode()`

问题描述 投票:1回答:1

我刚刚将我的react native应用程序升级到0.62.0,现在我的应用程序不断收到此警告标志

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.

我不确定为什么会出现此问题?有人可以解释吗?

我也看到Stack

ref.getNode |
createAnimatedComponent.js:129:20

SafeView#_updateMeasurements | index.js:192:14

SafeView#componentDidUpdate | index.js:154:9

更新

我相信这可能来自于react-navigation中的SafeAreaView

react-native react-navigation
1个回答
0
投票

如在宣布发布RN62的blog post中所见,getNode()现在已弃用。您可以仅使用ref而无需调用getNode()。参见此commit

© www.soinside.com 2019 - 2024. All rights reserved.