关于react-native中FlatList的 this指向问题

问题描述:在使用 FlatList 制作列表过程中,其 renderItem 属性返回的是一个 TouchableOpacity 的按钮,但是在触发其点击事件onPress时,总是报错! FlatList代码: _renderItem渲染item的代码:   报错原因: TouchableOpacity的onPress中使用了this,但他是不存在的,应用在FlatList的 renderItem
相关文章
相关标签/搜索