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

142
Vistas
Using the react-date-picker with react hook forms

So i wanted to use the react date picker with react hook forms. I referred this question and implemented this code:

<Controller
   control={control}
   name="deadline"
   render={({ field }) => (
             <DatePicker
             onChange={(date) => onChange(date)}
             value={value}
             format="dd-MM-y"
             clearIcon={<AiOutlineClose />}
             calendarIcon={<AiOutlineCalendar />}
             required
             monthPlaceholder="mm"
             dayPlaceholder="dd"
             yearPlaceholder="yyyy"
             style={{ color: "whitesmoke" }}
             minDate={new Date()}
             />
          )}
  />

const [value, onChange] = useState(new Date());

The problem I am facing is that, on submitting the form, i am not getting any error, but the value of the date field "deadline" is remaining undefined. The default value of the date picker is Current date. Is there something im doing wrong here ?

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