diff --git a/.jules/bolt.md b/.jules/bolt.md index e37d378..8874d93 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-15 - React Native FlatList Optimization +**Learning:** Missing windowing props in React Native FlatList causes unnecessary memory consumption and degrades scrolling performance on long lists. +**Action:** Always include initialNumToRender, windowSize, maxToRenderPerBatch, and removeClippedSubviews when implementing FlatList for long lists. diff --git a/src/screens/CalendarScreen.tsx b/src/screens/CalendarScreen.tsx index 7f7b563..131b384 100644 --- a/src/screens/CalendarScreen.tsx +++ b/src/screens/CalendarScreen.tsx @@ -886,7 +886,12 @@ export default function CalendarScreen() { {t('calPickName')} ({parsedSchedule.employees.length} trovati) - String(i)} style={{ maxHeight: 400 }} diff --git a/src/screens/FlightScreen.tsx b/src/screens/FlightScreen.tsx index 09dbe5d..67e1160 100644 --- a/src/screens/FlightScreen.tsx +++ b/src/screens/FlightScreen.tsx @@ -1546,6 +1546,11 @@ export default function FlightScreen({ openNotifSettingsSignal = 0 }: FlightScre ) : ( item.flight?.identification?.id || String(i)} renderItem={renderFlight} diff --git a/src/screens/PasswordScreen.tsx b/src/screens/PasswordScreen.tsx index a9611d8..247525a 100644 --- a/src/screens/PasswordScreen.tsx +++ b/src/screens/PasswordScreen.tsx @@ -305,6 +305,11 @@ export default function PasswordScreen() { {/* List */} item.id} renderItem={({ item }) => (