When I switching on week view or day view, and if event is not all day (have a range e.g. 1pm - 3pm) I've got an error - iterate is not a function
_baseOrderBy.js:24 Uncaught TypeError: iteratee is not a function
at _baseOrderBy.js:24
at arrayMap (_arrayMap.js:16)
at _baseOrderBy.js:23
at arrayMap (_baseMap.js:16)
at baseOrderBy (_baseOrderBy.js:22)
at sortBy.js:45
at apply (_apply.js:15)
at _overRest.js:32
at sortByRender (react-big-calendar.esm.js:2430)
at getStyledEvents (react-big-calendar.esm.js:2472)
Is someone can help with this error?
Event object example:
const [events, setEvents] = useState([]);
async function getEvents() {
const events = await api.getEvents();
const eventsList = evetns.map(item => ({
id: item.id,
label: item.label,
start: moment(item.start).toDate(),
end: moment(item.end).toDate(),
}));
setEvents(eventsList);
}
useEffect(() => {
getEvents();
}, []);
return (
<Calendar
events={events}
popup
onSelectSlot={(props) => selectSlot(props)}
/>
)