我使用redux几乎与async reddit redux示例完全一样,使用thunk中间件只在需要时更新状态(shouldFetch)。有没有人注意到React-Native ListView在网络调用更新商店后没有收到更改?如果我离开并返回它看起来很好。只是在网络通话(来自前一条路线)之后,它才会出现。
我的ListView.js
constructor(props) {
super(props)
let dataSource = new ListView.DataSource({
sectionHeaderHasChanged: this.sectionHeaderHasChanged,
rowHasChanged: (row1, row2) => row1 !== row2,
});
this.state = {
dataSource: dataSource.cloneWithRows(this.props.books),
}
this.renderRow = this.renderRow.bind(this);
this.selectBook = this.selectBook.bind(this);
}
selectBook(book) {
this.props.selectBook(book)
}
goTo(route) {
this.props.navigator.push({
name: route,
});
}
... + everything you'd expect