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

104
Visualizações
SetState of the selected option in the dropdown

My code looks like

placeholder="select banana or apple or cat" 

options=[
    {label : "Apple", value=2},
    { label : "Banana", value=3 },
    { label : "Cat", value=5}
]

value = { this.state.selectedOptions}
isSearchable={false}
isDisabled={this.state.isEdit === true}

and an onChange event. I am having an array called "result" which is storing a property called "list". This list is an array that contains "Entity-Type". If the Entity-type is 2 I should get Apple, if it's 3 I should get Banana, If it's 5 I should get cat. I need to set the state to map my options and Entity-Type. I don't know how to do that as I am new to react. I am able to see the Entity-Type in my response tab in dev tools but I am not seeing the selected option in my UI. I can see the option that I selected in before saving the package but after saving the package, whenever I want to Edit it I can see only placeholder there that is disabled. My package should have only one type of option. I have a heads up that is I should use result.list[0].EntityType.value for mapping.

about 4 years ago · Santiago Gelvez
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