升级到react-native 0.61后,我收到很多这样的警告:
VirtualizedLists should never be nested inside plain ScrollViews with the same orientation - use another VirtualizedList-backed container instead.
我应该使用的另一个VirtualizedList支持的容器
是什么,为什么现在建议不要这样使用?
最佳答案
如果有人仍在寻找针对 @Ponleu 和 @David Schilling 在此描述的问题的建议(关于 FlatList 之上的内容),那么这就是我采取的方法:
<SafeAreaView style={{flex: 1}}>
<FlatList
data={data}
ListHeaderComponent={ContentThatGoesAboveTheFlatList}
ListFooterComponent={ContentThatGoesBelowTheFlatList} />
</SafeAreaView>
您可以在这里阅读更多相关信息:https://facebook.github.io/react-native/docs/flatlist#listheadercomponent
希望它对某人有帮助。 :)
关于javascript - React-Native 另一个 VirtualizedList 支持的容器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58243680/