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

266
Views
Argument of type '{ name: string; email: string; password: string; }' is not assignable to parameter of type 'void'

I am using React Query with TypeScript.

Mutation:

   let mutation = useMutation((newUser) => {
      return signup(newUser)
   })

Submit function:

const onSignupSubmit = ({ name, email, password }: User) => {
      mutation.mutate(
          {
            name,
            email,
            password,
         }
      )
   }

Also this line giving me error:

mutation?.error?.response?.data?.field
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

you need to define the type of the mutation function passed to useMutation:

let mutation = useMutation((newUser: User) => {
    return signup(newUser)
})

a shorter way would be to omit the arrow function and just do:

let mutation = useMutation(signup)
about 4 years ago · Juan Pablo Isaza 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!