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

98
Vistas
Understanding React-hook-form Controller

I am working on a website that has been build before me and it uses a method of the Controller part of react-hook-form that I have not seen before.

This is an example of the code:

const CheckboxController = (props: CheckboxProps) => {
  return (
    <Wrapper>
      <Controller as={CheckboxInput} {...props} /> 
    </Wrapper>
  );
};

With CheckboxInput being a simple material-ui checkbox.

I understand the traditional method of using something like:

const CheckboxController = (props: CheckboxProps) => {
  return(
    <Controller
    name={props.name}
    control={props.control}
    render={({ field }) => (
      <label>
          <Checkbox
            onChange={(e) => field.onChange(e.target.checked)}
            checked={props.checked}
            disabled={props.isDisabled}
            />
            {props.label}
        </label>
      )}
    />
  );
};

But unfortunately the entire site is build upon the <Controller as={}> setup. I cant seem to find any info online about it to figure out how it works. Does anyone know about this method or can point me in the right direction? Thank you.

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

0

Barkley. It seems the project is using a lagacy version of react-hook-form, whose version is v5. You can find the api doc here: https://react-hook-form.com/v5/api

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