I'm confused that I have an map method inside that method I put some different properties in their span tag or div tag and I have to show star rate and for these element I used Array.from() , now I get a warning about I must use unique key , I don't know how to delete this warning
const Rating = ({ratings}) => {
return (
<div>
{ ratings.map((li, index) =>
<div className='ratings__item' key={index} >
<h3>{li.name}</h3>
<p>{li.content}</p>
{Array.from({length:li.rate}, () => <span>★</span> )}
{Array.from({length:5-li.rate}, () => <span>☆</span> )}
</div>
)}
</div>
)
}