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

2023-12-19

升级到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我应该使用它,为什么现在建议不要那样使用?


如果有人仍在寻找对 @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 https://facebook.github.io/react-native/docs/flatlist#listheadercomponent

希望它能帮助某人。 :)

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

React-Native 另一个 VirtualizedList 支持的容器 的相关文章

随机推荐