im using this library https://github.com/hypeserver/react-date-range
I want that when I click on a single day, it captures this event. I tried this but throws a DatePicker error. If I change the order of the parameters, the errors don't appear, but the console.log throws "undefined"
const handleDatesChange = (e, date) => {
console.log(e); // here i'm getting "undefined"
...
};
<DateRangePicker
preventSnapRefocus
showPreview
showSelectionPreview
direction="horizontal"
minDate={new Date()}
monthDisplayFormat="MMMM yyyy"
months={2}
ranges={calendarDates}
retainEndDateOnFirstSelection={false}
showDateDisplay={false}
showMonthAndYearPickers={false}
weekdayDisplayFormat="EEEEEE"
onChange={($event, item) => handleDatesChange($event, [item.selection])}
/>