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

132
Views
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
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!