//片段1:
<ListView
dataSource={dataSource}
renderRow={this._renderRow}
/>
//片段2:
class Demo extends Component {
constructor(props) {
super(props);
this.state = {
showId: 1
};
}
}
//片段3:
_renderRow (rowData: string, sectionID: number, rowID: number) {
alert(this.state.showId)//报错
}
片段一改改: