The Calendar updates correctly when i change the eventData, but if its empty its not updating and shows the previous data
<DayPilotCalendar
cellHeight="50"
viewType="Day"
startDate={date}
onTimeRangeSelected={async (e) => {
setStartTime(e.start.toString());
setEndTime(e.end.toString());
setOpenDialog(true);
}}
eventDeleteHandling="Update"
onEventClicked={(event) => {
setEventDataOfSchedule(event.e.data);
handleClickOpen();
}}
events={eventData}
onEventDelete={async (event) => {
// eslint-disable-next-line no-restricted-globals
if (!confirm("Do you really want to delete this event?")) {
event.preventDefault();
}
}}
/>