React Native onPress being called automatically

前端 未结 5 1371
悲&欢浪女
悲&欢浪女 2020-12-12 20:20

I am having trouble with react-native onPress Feature. The onPress should only work when it is actually been triggered by a touch event (i suppose) , that is when i press th

5条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-12 21:05

    onPress={this.handleevent.bind(this, 'A')}
    

    or use this:

    onPress={() => this.handleevent('B')}
    

提交回复
热议问题