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

160
Views
¿Cuál debería ser el tipo de errores al pasarlo como prop useform?

Tengo useform hook , donde obtengo un objeto de error. Así que estoy tratando de pasarlo a otro componente.

 const { register, handleSubmit, watch, control, formState: { errors, isDirty, isValid } } = useForm<CampaignForm>({ mode: 'all', resolver: yupResolver(validationSchema), defaultValues: { [FormFields.StartDate]: null, [FormFields.EndDate]: null, [FormFields.StartTime]: null, [FormFields.EndTime]: null, [FormFields.Locations]: `${strings.campaign.createCampaign.allRetailLocation}` }

})

 <Campaigon erros={errors} register={register}/>

interfaz es:

 interface ICampaign { register: any errors: any }

aquí, estoy usando any como un tipo para ambos. Entonces, ¿cuál debería ser el tipo de registro y errores?

Gracias por la ayuda.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

No tiene que pasar un tipo al gancho useForm. Puede permitir que TS infiera tipos aquí.

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!