我们说我有以下代码块:
componentWillMount() {
fetch('API_LINK', {
method: "GET"
})
.then((data) => data.json())
.then((data) => this.setState(datasource: ds.cloneWithRows(data)))
.done()
}
_renderRow(rowID){
return(
<Text>{rowID.title}</Text>
)
}
render() {
return(
//....
)
}
是否有某种事件可以帮助我确切知道ListView数据何时完成渲染并被吸引到应用程序中?
示例:
<ListView
dataSource={this.state.datasource}
renderRow={this._renderRow.bind(this)}
onRenderFinish={() => console.log("Finished loading!")}
/>