Quantcast
Channel: React-native FlatList not rerendering row when props change - Stack Overflow
Viewing all articles
Browse latest Browse all 10

Answer by Josh Siegl for React-native FlatList not rerendering row when props change

$
0
0

In my case I just made a simple mistake when using keyExtractor

I changed

keyExtractor={(item, index) => index.toString()} 

To

keyExtractor={(item, index) => item.key} 

I was seeing some strange effect after filtering my list where props of filtered out components were being rendered in place of new component's props, my hunch is that because I was using the index of the array rather than a unique key, I was just passing the old props to the new component even though the base component was in fact changing.


Viewing all articles
Browse latest Browse all 10

Latest Images

Trending Articles





Latest Images