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

162
Vistas
what should be the type of errors while passing it as prop useform

I have useform hook , where I am getting an errors object. So I am trying to pass it to other componenet.

 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}/>

interface is :

interface ICampaign {
  register: any
  errors: any
}

here, I am using anyas a type for both. So, what should be the type for register and errors.

Thanks for the help.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You don’t have to pass a type into the useForm hook. You can allow TS to infer types here.

about 4 years ago · Juan Pablo Isaza 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