React: update one item in a list without recreating all items

前端 未结 6 482
隐瞒了意图╮
隐瞒了意图╮ 2021-01-30 05:27

Let\'s say I have a list of 1000 items. And I rendering it with React, like this:

class Parent extends React.Component {
  render() {
    // this.state.list is a         


        
6条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-30 05:46

    EDIT:

    My inital suggestions only addressed possible efficiency improvements to rendered lists and did not address the question about limiting the re-rendering of components as a result of the list changing.

    See @xiaofan2406's answer for a clean solution to the original question.


    Libraries that help make rendering long lists more efficient and easy:

    React Infinite

    React-Virtualized

提交回复
热议问题