reactjs - RN-Redux VirtualizedList:你有一个更新缓慢的大列表
问题描述
我正在使用来自 React Native 的 redux state(~200 个产品)和 SectionList。
我得到的错误:
VirtualizedList:您有一个更新缓慢的大型列表 - 确保您的 renderItem 函数呈现遵循 React 性能最佳实践的组件,例如 PureComponent、shouldComponentUpdate 等 Object { "contentLength": 7363.66650390625, "dt": 1513, "prevDt" : 892, }
有什么我可以做的吗? renderItem 函数只是一个返回 React 组件的简单函数。
谢谢你。
代码:
<SectionList
sections={catalog}
keyExtractor={(item, index) => item.id ?? item}
renderItem={renderItem}
/>
解决方案
推荐阅读
- python - 无意义的空间名词
- php - 将页面视图添加到 API 的 WordPress 功能
- windows - Rsync > 不同步 Windows 快捷方式的内容
- c - 选择较小的错误不正确的 Printf() 语句:更少的参数与额外的参数
- javascript - 如何使用 javascript(加载时)回显节点值?
- clickhouse - 如何在 Clickhouse 中使用数组连接
- python - Blender - 尝试安装 Sverchok 插件 Scipy 包,但 PIP 已过时并且 ~WinError 5 Access denied
- python - mac:尝试使用 pip 安装 mssql-cli 失败并出现语法错误
- conv-neural-network - 针对特定全连接 nn 或 CNN 的 ASIC 设计
- matplotlib - 如何使用 matplotlib 为一系列 Seaborn 热图制作动画并导出为 mp4 文件?