Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

219
Views
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 answers
Answer question

0

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

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!