使用react-navigation时出现错误警告

报错信息:

   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.
  1. 导致报错原因:

    在使用react-navigation时,通过Button的onPress事件进行路由跳转时,会抛出此错误警告

网上找也没找到类似错误,Button的点击事件,均会导致报错,不管是不是路由跳转,还是其他


撒科打诨
浏览 1265回答 1
1回答

jeck猫

已碰到此相同问题.解决方案:&nbsp;必须使用TouchableOpacity 包裹起来, 才可以解决此问题import {TouchableOpacity} from 'react-native';&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <TouchableOpacity onPress={onPress}>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;...&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </TouchableOpacity>
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript