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

164
Visualizações
Select box not resetting - React JS

This might be pretty basic but i am not able to find out what is wrong here. I have a react form in which i am using a custom select box to list the students. I want to clear the selection when isChecked is set to false.

 let studentId = watch("std.id"); // is of type number
      
<Select
 name="std.id"
 placeholder="Select Students"
 registerResult={register("std.id")}
 list={studentList}
 disabled={!isChecked}
/> 

I tried emptying with "" the value also tried assigning it to null like below, but didnt work. can anyone tell me why is it not resetting?

if(!isChecked){
  studentId = null;  //Select box still shows the selected value even after this
}

        
about 4 years ago · Juan Pablo Isaza
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