1
- [24.1]你正在使用的React Native的版本是什么?
- [both]这是发生在iOS,Android还是两者?
- [Mac]您使用的是Mac,Linux还是Windows?
我这样做:react-native renderRow with button:push rowData to button-function
_onPress(data) {
Actions.shopProducts(data);
}
...
renderRow(rowData){
return (
<Button onPress={this._onPress.bind(this)}>
<View style={styles.row}>
<View style={styles.listViewContainer}>
<Image
source={{uri: rowData.image}}
/>
<View style={styles.rightContainer}>
<Text style={styles.smallText}>Name: {rowData.name}</Text>
<Text style={styles.smallText}>Straße: {rowData.address}</Text>
<Text style={styles.smallText}>Ort: {rowData.location}</Text>
</View>
</View>
</View>
</Button>
);
}
...
我收到以下错误:
Possible Unhandled Promise Rejection (id: 0): undefined is not an object (evaluating 'this._onPress.bind') renderRow @...
我很激动盟友使用react-native-router-flux和react-native-button。
是什么导致了这个错误?我不明白这个...
问候
编辑: 现在我想知道如何rowData推到我的按钮功能...任何想法?
这正是导致错误。非常感谢! – NullPointer
你知道吗,如何将rowData推送到我的函数中? – NullPointer
@AlbanVeliu不要忘记传递'dataSource'属性,看看我更新的答案 – Cherniv