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
         return displayData;
53
         return displayData;
54
     }
54
     }
55
 
55
 
56
+    itemLayout = (data, index) => ({length: LIST_ITEM_HEIGHT, offset: LIST_ITEM_HEIGHT * index, index});
57
+
58
+
56
     render() {
59
     render() {
57
         const item = this.props.item;
60
         const item = this.props.item;
58
         return (
61
         return (
82
                         keyExtractor={this.keyExtractor}
85
                         keyExtractor={this.keyExtractor}
83
                         listKey={item.id.toString()}
86
                         listKey={item.id.toString()}
84
                         // Performance props, see https://reactnative.dev/docs/optimizing-flatlist-configuration
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
                 </AnimatedAccordion>
91
                 </AnimatedAccordion>
89
             </View>
92
             </View>

Loading…
Cancel
Save