Overview
The search results FlatList does not have a keyExtractor prop. React Native uses the array index as the key, causing incorrect re-renders when results are reordered or filtered, and triggering React key warnings in development.
Specifications
Features:
- Add
keyExtractor={(item) => item.id} to the search results FlatList
- Confirm all other FlatLists in the app have unique, stable key extractors
Tasks:
- Add
keyExtractor to the search results list
- Audit all FlatList usages in the codebase for missing
keyExtractor
- Write a test that renders the list with reordered results and confirms no key warning
Impacted Files:
src/screens/SearchScreen.tsx
- All FlatList usages missing keyExtractor
Acceptance Criteria
- No React key warnings in development mode
- List re-renders correctly when results are reordered
- All FlatLists in the app have stable keyExtractors
Overview
The search results
FlatListdoes not have akeyExtractorprop. React Native uses the array index as the key, causing incorrect re-renders when results are reordered or filtered, and triggering React key warnings in development.Specifications
Features:
keyExtractor={(item) => item.id}to the search results FlatListTasks:
keyExtractorto the search results listkeyExtractorImpacted Files:
src/screens/SearchScreen.tsxAcceptance Criteria