Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

247
Views
how put key when Array.from() inside a map method

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>&#9733;</span> )}
              {Array.from({length:5-li.rate}, () => <span>&#9734;</span> )}
        </div>
    )}
        </div>
    )
}
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!