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

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

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 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