Browse Source

Further performance improvements

Arnaud Vergnet 3 years ago
parent
commit
2dab27de22
1 changed files with 5 additions and 2 deletions
  1. 5
    2
      src/components/Lists/PlanexGroups/GroupListAccordion.js

+ 5
- 2
src/components/Lists/PlanexGroups/GroupListAccordion.js View File

@@ -53,6 +53,9 @@ class GroupListAccordion extends React.Component<Props> {
53 53
         return displayData;
54 54
     }
55 55
 
56
+    itemLayout = (data, index) => ({length: LIST_ITEM_HEIGHT, offset: LIST_ITEM_HEIGHT * index, index});
57
+
58
+
56 59
     render() {
57 60
         const item = this.props.item;
58 61
         return (
@@ -82,8 +85,8 @@ class GroupListAccordion extends React.Component<Props> {
82 85
                         keyExtractor={this.keyExtractor}
83 86
                         listKey={item.id.toString()}
84 87
                         // Performance props, see https://reactnative.dev/docs/optimizing-flatlist-configuration
85
-                        // getItemLayout={this.itemLayout} // Broken with search
86
-                        // removeClippedSubviews={true}
88
+                        getItemLayout={this.itemLayout}
89
+                        removeClippedSubviews={true}
87 90
                     />
88 91
                 </AnimatedAccordion>
89 92
             </View>

Loading…
Cancel
Save