#Clear DatePickerInput value when undefined

5 messages Ā· Page 1 of 1 (latest)

lethal lintel
#

I'm using DatePickerInput component in a form but after resetting the form the DatePicker still shows the date.
How do I clear the DatePickerInput when I reset it's value to undefined ?

lethal lintel
#

@drowsy hedge thanks for the help. I was using undefined as I usually do and thought there was a problem. I even tried changing the onChange but no luck there. I guess this should be in the documentation or if it is it should be in a place more readable because I couldn't find this info.

drowsy hedge
#
const [value, setValue] = useState<Date | null>(null);