小编典典

React-Native另一个由VirtualizedList支持的容器

reactjs

升级到react-native 0.61之后,我收到很多类似的警告:

VirtualizedLists should never be nested inside plain ScrollViews with the same orientation - use another VirtualizedList-backed container instead.

VirtualizedList-backed container我应该使用其他什么?为什么现在不建议那样使用?


阅读 1580

收藏
2020-07-22

共1个答案

小编典典

如果有人仍在寻找有关@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

希望它可以帮助某人。:)

2020-07-22