React Native ListView警告:in next release empty section headers ...

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/jing85432373/article/details/54291435

升级React Native到最新版本出现了一个Warning

Warning:In next release empty section headers will be rendered.
In this release you can use 'enableEmptySections' flag to render empty section headers

这个错误出现在ListView中,在以后的版本中才会实现空的section headers作为默认值,当前版本并没有支持。
如果我们不需要使用headers的话,可以禁止EmptySections
解决方法:

 <ListView
      style={styles.listView}
      dataSource={this.state.dataSource}
      enableEmptySections={true}
      />

参考文档:
http://facebook.github.io/react-native/docs/listview.html#enableemptysections

猜你喜欢

转载自blog.csdn.net/jing85432373/article/details/54291435