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

142
Views
Implementing an individual voting counter in each card

I'm currently working on a React project where I display cards with informations from an array of Objects, so that their content is dynamic. Now I would like to implement a like and a dislike counter on each card to vote the articles.

My problem is, how to fix this, so that when I click on (like), that it just ads 1 to that specific card and not in all of them. Because I'm mapping through the data array.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Look into using the .map method in your JSX. It allows you to iterate through multiple values and you can set your methods to individually mapped elements. Make sure to include a key in the element as well.

Further info: https://reactjs.org/docs/lists-and-keys.html

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!