0

I have a virtualized list of expensive Components. Occasionally, the list will mutate but it will force a re-render of the rows that have shifted either up or down one position.

For example, if there are 5 visible rows and I insert a new row at index 3, the component that was in row 3 unmounts and then remounts in row 4.

How can I prevent that unmount and re-render?

oppositeday
  • 113
  • 1
  • 5

1 Answers1

0

As you know, the rowRenderer function gives out a 'key' prop. DO NOT use that key value and use your own key (for example the item ID). This will reduce your re-renders.

Arman Karimi
  • 61
  • 1
  • 7