Kha*_*nus 1 javascript state reactjs react-native
我有这样的状态
constructor(props) {
super(props);
this.state = {
activeRegion: listProvince,
listProvince: [],
listCity: [],
listRegion: [],
}
}
Run Code Online (Sandbox Code Playgroud)
以及如何使用其他状态的状态?
所以我要在 flatlist 中使用的数据是基于 activeRegion
当 activeRegion 中的值是 Flatlist 中使用的 ListCity 数据是 this.state.listcity
等等
<FlatList
data={this.state.{this.state.activeregion}}
renderItem={({ item }) => (this.renderItem())
/>
Run Code Online (Sandbox Code Playgroud)
如何实现这一目标?
| 归档时间: |
|
| 查看次数: |
47 次 |
| 最近记录: |