Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

139
Vistas
React map inside map cloning on re-render

So I am rendering a map:

{categories.map((category, index) => {

and inside this map I am rendering another:

{challenges.map((challenge, index) => {

and they all render correctly but for example once I delete a challenge and call the getChallenges() (gets the challenges from server) which is what I also call at the first render with useEffect() it renders the categories properly but the challenges map inside the categories map gets doubled so I have the old & new ones. Anyway to prevent this or any way I can render the categories map and then the challenges map appending them to their correct category? Thanks for your help in advance I hope I was clear!

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Solved because I was passing in an object as the 'key' so it was just [Object, Object] which made it not unique. Fixed by switching to challenge._id

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda