当前位置: > > > React Native - `useNativeDriver` is not supported警告的解决办法

React Native - `useNativeDriver` is not supported警告的解决办法

1,问题现象

最近把 react-native 的版本升级后,调用 TouchableOpacity (触摸透明) 时报如下警告信息。
Warning encountered 1 time.
Animated:`useNativeDriver` is not supported because the native animated module is missing. Falling back to JS-based animation. To resolve this, add `RCTAnimation` module to this app, or remove `useNativeDriver`.

2,问题原因

升级默认没有添加 RCTAnimation 依赖,添加相关依赖即可。

3,解决办法

在工程目录执行下执行如下命令即可:
react-native link react-native
评论0