In this video we integrate the Antd #datepicker component with #reactjs Hook Form in a reusable way. We end up with a reusable component that configures the Antd Datepicker and the react-hook-form Controller to work together.
🔗 Starting point: https://codesandbox.io/s/antd-datepicker-with-react-hook-form-pk4ppl
🔗 End result: https://codesandbox.io/s/antd-datepicker-with-react-hook-form-forked-cuj3yb?file=/src/App.tsx
React Hook Form Docs Page: https://react-hook-form.com/get-started
AntD Docs Page: https://ant.design/components/date-picker#datepicker
Dayjs Docs: https://day.js.org/docs/en/display/unix-timestamp-milliseconds
📝 Chapters:
00:00 Intro & Overview
00:51 Initial Setup
02:43 Serialising and Deserialising Date
05:30 Adding the React Hook Form Controller
10:35 Reusable Controlled Date Picker
13:23 Conclusion & Up Next
Download
0 formats
No download links available.
How to use AntD's Datepicker with React Hook Form | NatokHD