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

245
Views
Each child in a list should have a unique "key" prop. but i'm not calling any component

if i call all discount price using map method. it perfectly work but i see in console and like this error are found. how to fix it

 <div className="priceCal flex flex-col items-center">
       <p style={{ fontSize: '1.5em' }} className='font-medium pt-3'>Total items: </p>
          {
            data.map((v, i)=>{
            return <p className='font-bold text-xl'>Rs. {v.DiscountPrice}</p>
             })
         }
</div>

Click to view the error



react-jsx-dev-runtime.development.js:117 Warning: Each child in a list should have a unique "key" prop.

Check the render method of `Cart`. See https://reactjs.org/link/warning-keys for more information.
    at p
    at Cart (http://localhost:3000/static/js/bundle.js:3393:74)
    at Routes (http://localhost:3000/static/js/bundle.js:63733:5)
    at RouterMenu
    at App (http://localhost:3000/static/js/bundle.js:140:81)
    at Router (http://localhost:3000/static/js/bundle.js:63666:15)
    at BrowserRouter (http://localhost:3000/static/js/bundle.js:63146:5)
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

You need to add a key to the parent element of the return like this

return <p className='font-bold text-xl' key={i}>Rs. {v.DiscountPrice}</p>

But it's better to use a unique property of the object like key={v.id} if id exists

about 4 years ago · Juan Pablo Isaza Report

0

You are looping over

data.map((v, i)=>{
        return <p className='font-bold text-xl'>Rs. {v.DiscountPrice}</p>
})

Just add a key to the return JSX

data.map((v, i)=>{
        return <p key={i} className='font-bold text-xl'>Rs. {v.DiscountPrice}</p>
})

If you have a unique identifier in the v object, use that

Refer => https://reactjs.org/docs/lists-and-keys.html#keys

about 4 years ago · Juan Pablo Isaza Report
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!