首页 > 解决方案 > 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}
      />


标签: reactjsreact-nativereact-redux

解决方案


推荐阅读