From b1accc0b0fdf9e92358f602271732311b96075e0 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Fri, 17 Apr 2026 01:28:17 +0000 Subject: [PATCH] Optimize list rendering in FlightScreen with FlatList props Added standard optimization props (initialNumToRender, windowSize, maxToRenderPerBatch, removeClippedSubviews) to the FlatList component in FlightScreen.tsx to improve rendering efficiency and memory consumption when scrolling through long lists of flights. Co-authored-by: TargetMisser <52361977+TargetMisser@users.noreply.github.com> --- .jules/bolt.md | 3 +++ src/screens/FlightScreen.tsx | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/.jules/bolt.md b/.jules/bolt.md index e37d378..2cbd571 100644 --- a/.jules/bolt.md +++ b/.jules/bolt.md @@ -1,3 +1,6 @@ ## 2024-04-13 - Missing React.memo for FlatList Items **Learning:** The React Native FlatList components in this codebase frequently render unmemoized inline items (like `ContactRow`, `PasswordRow`, etc.), causing unnecessary re-renders of the entire list when individual state changes. **Action:** Always wrap long list item components in `React.memo()` to prevent cascading re-renders and improve FlatList scrolling performance. +## 2026-04-17 - FlatList Missing Optimization +**Learning:** The project is missing 'initialNumToRender', 'windowSize', 'maxToRenderPerBatch', and 'removeClippedSubviews' attributes for `FlatList` components. +**Action:** Add these attributes to optimize list rendering. diff --git a/src/screens/FlightScreen.tsx b/src/screens/FlightScreen.tsx index 7b37ca6..97b7153 100644 --- a/src/screens/FlightScreen.tsx +++ b/src/screens/FlightScreen.tsx @@ -818,6 +818,11 @@ export default function FlightScreen() { refreshControl={ { setRefreshing(true); fetchAll(); }} tintColor={colors.primary} />} ListEmptyComponent={{t('flightNoFlights')}} showsVerticalScrollIndicator={false} + // Performance optimization: improve rendering efficiency of large lists + initialNumToRender={10} + windowSize={5} + maxToRenderPerBatch={10} + removeClippedSubviews={true} /> )}