报错信息: Attempted to transition from state `RESPONDER_INACTIVE_PRESS_IN` to `RESPONDER_ACTIVE_LONG_PRESS_IN`, which is not supported.
This is most likely due to `Touchable.longPressDelayTimeout` not being cancelled.导致报错原因:在使用react-navigation时,通过Button的onPress事件进行路由跳转时,会抛出此错误警告网上找也没找到类似错误,Button的点击事件,均会导致报错,不管是不是路由跳转,还是其他
1 回答
jeck猫
TA贡献1909条经验 获得超7个赞
已碰到此相同问题.
解决方案:
必须使用TouchableOpacity 包裹起来, 才可以解决此问题
import {TouchableOpacity} from 'react-native';
<TouchableOpacity onPress={onPress}>
...
</TouchableOpacity>
添加回答
举报
0/150
提交
取消
