获得徽章 0
同学的一次面试题,**为什么不推荐index作为key**
官网就有回答:We don’t recommend using indexes for keys if the order of items may change. This can negatively impact performance and may cause issues with component state
我们不建议使用索引来用作 key 值,列表项目的顺序会发生变化,因为这样做会导致性能变差,还可能引起组件状态的问题。
展开
评论
下一页
个人成就
文章被点赞 26
文章被阅读 4,497
掘力值 286
收藏集
2
关注标签
18
加入于