I am creating an app with React Native
and I've used the map
method to show two items in an array.
But the warning keeps showing:
Each child in a list should have a unique "key" prop.
Here is my code:
<View>
{arrayType.map((item, key)=> {
return(
<>
<View key={item + key} style={customStyle.main}>
<Text>{item}</Text>
</View>
</>
)
})}
</View>
Why is it still showing that warning?