我正在开发一个react-native项目。我已经在我的组件之一中实现了列表视图。React native:如何在ToastAndroid中打印变量值
render() {
return (
dataSource = {this.state.dataSource}
renderRow = {this._renderRow.bind(this)}
renderHeader = {() => }
onEndReached = {() => console.log('')}
renderSeparator = {(sectionID, rowID) =>
style={styles.style_separator}
key={`${sectionID} - ${rowID}`}
/>}
/>
);
}
_renderRow(rowData: string, sectionID: number, rowID: number) {
console.log('render row ...');
return (
{rowData.row}
{rowData.isSelect ? 'true' : 'false'}
);
}
_onPressRow(rowID, rowData) {
ToastAndroid.show('here is your row id... ', ToastAndroid.SHORT);
}
现在,在onPressRow功能,我想打印row ID。我曾尝试过,
ToastAndroid.show('here is your row id...(rowID) ', ToastAndroid.SHORT);
ToastAndroid.show('here is your row id...{rowID} ', ToastAndroid.SHORT);
但没有得到成功。
任何帮助是最受欢迎的。