1

我使用的 redux 几乎与异步 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
4

0 回答 0