onChange
Description
Optional. Fires when a new date is selected in a date pickerUsage
onChange?: (ev: { value: Date | null }) => void;
Parameters
The callback of the event takes an object with the following parameter:
- value - (required) Date object with the date as a newly selected value
Example
function handleSelect({ value }: { value: Date | null }) {
console.log(value);
// date object or null
}
<DatePicker onChange={handleSelect} />