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

161
Vistas
List items get duplicated in React Native

I have the following code sequence where some calendar data is checked with scheduling data. The problem is that if there are 2 or more appointments, I get the rest duplicated, tripled. How can I change?

enter image description here

{ programari.map(val=>{

  if(val.date==selectedDate){
    if(val.hour==hour){
      return(
        <RadioButton.Item label={hour} value={hour} disabled={true} style={{backgroundColor:'red',opacity:0.4}} />
      )  
    }        
    else return <RadioButton.Item label={hour} value={hour} disabled={false} style={{backgroundColor:'green',opacity:0.4}} />
  }

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

0

Did you check the contents of programari? is you have duplicates in this list you will need to erase the duplicates. It is easy to avoid duplicates if somehow you use a set and from the set you create programari. On the other hand, shouldn't you consider minutes, too? Dominic also suggested the use of a Key and this is true. As key, you can use the index of the element in programari concatenated with something else to get a unique value.

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