dohomi / react-hook-form-mui

Material-UI form components ready to use with react-hook-form
https://react-hook-form-material-ui.vercel.app
MIT License
561 stars 111 forks source link

fix: read string value as date in internal validation #323

Closed sadik-malik closed 1 month ago

sadik-malik commented 1 month ago

320

When date values were provided as strings, internal validation was performed on the string instead of a Date object, causing the following components to throw console errors:

This PR fixes the issue by transforming the value into a Date object before performing validation.

Additional Notes

@dohomi, it might be worth considering changing the default behavior to stop accepting string values for x-date-pickers, as MUI's date picker components themselves do not accept strings by default.

vercel[bot] commented 1 month ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-hook-form-material-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 17, 2024 5:38pm