Skip to content

Commit

Permalink
Merge pull request Expensify#19345 from janicduplessis/@janic/reports…
Browse files Browse the repository at this point in the history
…-perf-2

Increase VirtualizedList batch size on iOS and Android
  • Loading branch information
mountiny authored Sep 21, 2023
2 parents d7205e5 + 2c16083 commit b225b53
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/components/InvertedFlatList/BaseInvertedFlatList.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,6 @@ class BaseInvertedFlatList extends Component {
// Native platforms do not need to measure items and work fine without this.
// Web requires that items be measured or else crazy things happen when scrolling.
getItemLayout={this.props.shouldMeasureItems ? this.getItemLayout : undefined}
// We keep this property very low so that chat switching remains fast
maxToRenderPerBatch={1}
windowSize={15}

// Commenting the line below as it breaks the unread indicator test
Expand Down
3 changes: 3 additions & 0 deletions src/components/InvertedFlatList/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ function InvertedFlatList(props) {
shouldMeasureItems
contentContainerStyle={StyleSheet.compose(contentContainerStyle, styles.justifyContentEnd)}
onScroll={handleScroll}
// We need to keep batch size to one to workaround a bug in react-native-web.
// This can be removed once https://github.com/Expensify/App/pull/24482 is merged.
maxToRenderPerBatch={1}
/>
);
}
Expand Down

0 comments on commit b225b53

Please sign in to comment.