Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

146
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda