How to set a default empty value for DatePicker and avoid console warning? #4093
Unanswered
vim-diesel
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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
new Date()
but that defaults it to today's date.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.
How can I leave it empty and avoid this error?
I am using NextJS with TypeScript and ShadCN, most recent versions
Beta Was this translation helpful? Give feedback.
All reactions