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

标签 javascript reactjs react-native

升级到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/

相关文章:

javascript - 无法读取未定义的属性 'location'

javascript - 如何在 React Native 中安装组件之前显示微调器?

react-native - 如何在 react-native 中渲染 epub 文件

javascript - ReactJs 查找绑定(bind)到元素的所有事件

Javascript -- 将窗口高度增加一个像素 -- Google Chrome

javascript - VSCode 仅在某处导入时通过相应的 Foo.d.ts 为 Foo.js 提供智能感知;如何在 Foo.js 本身中启用智能感知?

reactjs - 使用 typescript 的 create-react-app 不起作用

javascript - 如何将坐标数组映射到 React Native map 标记中?

javascript - 将一些初始数据传递到新窗口的正确方法是什么?

javascript - 更改 Canvas 绘制图像的原点