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} /> )}