How to set a default empty value for DatePicker and avoid console warning? #4093
-
I am using DatePicker in a form, and am using state to control the value:
I want the default value of the date to be empty, so the user has to select a date. But if the user selects a date, I get a big warning in the console:
I can avoid the error by setting the state as I don't want to set a default value for the state, because the user might pass over it in the form, since it is already filled out. I am using NextJS with TypeScript and ShadCN, most recent versions |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
it was actually a hidden input field I was using to pass the value to a server action, switching from an undefined value to a string. So this had nothing to do with the component. |
Beta Was this translation helpful? Give feedback.
it was actually a hidden input field I was using to pass the value to a server action, switching from an undefined value to a string. So this had nothing to do with the component.