From 25f791d626a4dde241a8f5862d01079d5472f194 Mon Sep 17 00:00:00 2001 From: Hamid Date: Tue, 6 Apr 2021 18:51:40 +0430 Subject: [PATCH] dont rerender list items --- Libraries/Lists/VirtualizedList.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Libraries/Lists/VirtualizedList.js b/Libraries/Lists/VirtualizedList.js index a7c1567b3f607a..aaa39325a822d1 100644 --- a/Libraries/Lists/VirtualizedList.js +++ b/Libraries/Lists/VirtualizedList.js @@ -1995,6 +1995,14 @@ class CellRenderer extends React.Component< this.props.onUnmount(this.props.cellKey); } + shouldComponentUpdate(nextProps, nextState) { + return !!( + (this.props.ItemSeparatorComponent && + this.state.separatorProps !== nextState.separatorProps) || + this.props.item !== nextProps.item + ); + } + _renderElement(renderItem, ListItemComponent, item, index) { if (renderItem && ListItemComponent) { console.warn(