I have tried all the possible solutions that I know of. I have tried several other solutions to similar problems but I do not understand how this is supposed to work. I am trying to call a function from inside a ListView renderRow method. I can now call the function but I cannot pass in the selected rowData that I need. This is what I am getting:
I need the selected rowData. here is code
constructor(props) {
super(props);
this.onSubmitTrip = this.onSubmitTrip.bind(this);
this.onSelectTrip = this.onSelectTrip.bind(this);
this.renderRow = this.renderRow.bind(this);
this.state = {
dataSource: ds,
showSubmitTripBtn: false
}
}
onSelectTrip(rowData) {
selectedTrip = rowData;
}
renderRow(rowData) {
return (
<TouchableHighlight onPress={this.onSelectTrip} underlayColor='#dddddd'>
<View style={styles.row}>
<View style={{ paddingLeft: 5 }}>
<View>
<Text style={{ fontWeight: "bold", fontSize: 24 }}>{rowData.tripName}</Text>
</View>
</View>
</View>
</TouchableHighlight>
)
}

this.renderRow(theData).