const data = [
{id: 1, name: 'irfan'},
{id: 2, name: 'dami'},
];
<FlatList
data={data}
renderItem={({item}) => <Text>{item.name}</Text>}
keyExtractor={(item) => item.id.toString()}
/>
React Native and Dependencies:
react-native: 0.76.6,
react-native-gesture-handler: ^2.22.0,
react-native-screens: ^4.6.0
Error Details:
I get this error when the
FlatList
is rendered. The warning suggests there is an issue with child removal in the view hierarchy, but I’m not sure how to fix it.
I’ve verified that my keyExtractor
is returning a string from the item’s id, and the data array is being passed correctly.
Steps I’ve already tried:
Has anyone encountered this issue before?
I was able to work around the same issue by adding removeClippedSubviews={false}
to FlatList
prop.