Attempted to transition from state `RESPONDER_INACTIVE_PRESS_IN` to `RESPONDER_ACTIVE_LONG_PRESS_IN`

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.

最近在RN中使用TouchableOpacity组件里使用onPress方法时,报以上错误,原因是因为自己把代码直接写在了onPress中,把代码放进函数在onPress中调用即可

posted @ 2022-04-09 21:14  一颗小行星-  阅读(21)  评论(0)    收藏  举报