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

222
Vistas
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 Respuestas
Responde la pregunta

0

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

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