Skip to content

Increase VirtualizedList batch size on iOS and Android #19345

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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