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

221
Visualizações
How come there's an argument type function(any) is not assignable to parameter type with React Hook Use State

I've tried to follow to online tutorial on how to update a state when using React Hooks. Somehow the code is working but the IDE (WebStorm) is complaining about it.

Essentially, what I am trying to accomplish is to only update one of the variables inside the object that I define in the useState. Oh, I am using JavaScript and not TypeScript.

For example:

const[test, setTest] = useState({isvalid:false, isCommon:false});
...
function validate(){
   setTest((prevState) =>({...prevState, isValid:true}))
}

In the IDE I am getting:

Argument type function(any) & {isValid: boolean} is not assignable to parameter type...

enter image description here

about 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

please vote for WEB-55655 to be notified on any progress with it

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