Key issues when using FlatList
See original GitHub issueWhen trying to render swipeable in FlatList component, i get the following error:
ExceptionsManager.js:71 Warning: Each child in an array or iterator should have a unique “key” prop.
Check the render method of Swipeable
. It was passed a child from DiscogsSearch. See https://fb.me/react-warning-keys for more information.
Is Swipeable compatible with Flatlist?
Also the swipe actions fire multiple times on one swipe, but i’m not sure if that is a related issue.
Issue Analytics
- State:
- Created 6 years ago
- Comments:12
Top Results From Across the Web
How can resolve problem of Key in FlatList React native
Well, you've some data in your array that has a duplicate id property. Fix your data or select a better, more unique property...
Read more >8 ways to optimize React native FlatList performance
React native FlatList can have performance issues sometimes depending ... As a rule of thumb in react, Always use keys for your list...
Read more >A deep dive into React Native FlatList - LogRocket Blog
Common problems and questions · Images do not render · Inverting the list · The list should re-render when a variable changes ·...
Read more >Optimizing Flatlist Configuration - React Native
Blank areas: When VirtualizedList can't render your items fast enough, you may enter a part of your list with non-rendered components that ...
Read more >A guide to optimizing Flatlists in React Native. - Obytes
Use Key Extractor · Avoid anonymous functions · Get Item layout · MaxToRenderPerBatch · Profiling · Optimize your images · useMemo & useCallback....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Had this issue as well, though it was only showing up on iOS. Resolved it by adding a
key
prop to the highest level component to my Swipeable’srightContent
(a<View>
in my case).Check #3
As for the key prop, you either have to pass the key prop to your renderItem function:
or implement
keyExtractor
for theFlatList
:_keyExtractor = (item, index) => item.id;