I have an array of objects which I use to list values in page with map. But from time to time I receive this error.
Warning: Each child in a list should have a unique "key" prop.
Although keys are unique.
Maybe anyone knows what could be wrong here?
const items = [
{key: 1, name: 'Item one', value: 34 },
{key: 2, name: 'Item two', value: 45 },
{key: 3, name: 'Item three', value: 12 },
]
const item = ({ name, value, key }) => (
<div>
<p>{name}</p>
<p>{value}</p>
</div>
)
return(
<div>
{items.map(i => item(i))}
</div>
)