React/Redux rendering a list that's updating every second

后端 未结 5 914
生来不讨喜
生来不讨喜 2021-02-01 06:44

I have a react component that receives props from the redux store every second. The new state has an array that\'s different than the last array. To be specific, every second an

5条回答
  •  感情败类
    2021-02-01 06:58

    There is quite an easy solution for this. React VDOM is just a diffing algorithm. The only piece missing with your JSX is something called key which is like an id that the diffing algo uses and renders the particular element. Just tag the element with a KEY something like this https://reactjs.org/docs/lists-and-keys.html#keys

  • {number}
提交回复
热议问题