5. You want to improve user retention by optimizing a React Native app that loads a large list. Which combined approach best improves performance and keeps users engaged?
hard
A. Use FlatList with keyExtractor and avoid inline functions in renderItem
B. Render all items at once with heavy animations for each
C. Use ScrollView with many nested Views and no keys
D. Load all data synchronously on app start without caching
Solution
Step 1: Choose efficient list component
FlatList renders only visible items, improving performance over ScrollView.
Step 2: Optimize rendering with keys and stable functions
Using keyExtractor and avoiding inline functions prevents unnecessary re-renders.
Final Answer:
Use FlatList with keyExtractor and avoid inline functions in renderItem -> Option A