From 2dab27de22853d5428d34a99c0d3c7da4b360ee5 Mon Sep 17 00:00:00 2001 From: Arnaud Vergnet Date: Fri, 1 May 2020 16:38:57 +0200 Subject: [PATCH] Further performance improvements --- src/components/Lists/PlanexGroups/GroupListAccordion.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/Lists/PlanexGroups/GroupListAccordion.js b/src/components/Lists/PlanexGroups/GroupListAccordion.js index 73139cd..dcf4377 100644 --- a/src/components/Lists/PlanexGroups/GroupListAccordion.js +++ b/src/components/Lists/PlanexGroups/GroupListAccordion.js @@ -53,6 +53,9 @@ class GroupListAccordion extends React.Component { return displayData; } + itemLayout = (data, index) => ({length: LIST_ITEM_HEIGHT, offset: LIST_ITEM_HEIGHT * index, index}); + + render() { const item = this.props.item; return ( @@ -82,8 +85,8 @@ class GroupListAccordion extends React.Component { keyExtractor={this.keyExtractor} listKey={item.id.toString()} // Performance props, see https://reactnative.dev/docs/optimizing-flatlist-configuration - // getItemLayout={this.itemLayout} // Broken with search - // removeClippedSubviews={true} + getItemLayout={this.itemLayout} + removeClippedSubviews={true} />