In my project I am trying to initialize react-big-calendar but it's saying that it doesn't exist.
Uncaught TypeError: Cannot read property 'momentLocalizer' of undefined
my package versions: "react-dom": "16.2.0", "react-big-calendar": "^0.20.1", "moment": "^2.22.2",
Does anyone have any solutions to these problems?
I know that there was such a problem, but it concerned an older version that did not require an localizer.
import * as React from 'react';
import BigCalendar from 'react-big-calendar';
import * as moment from 'moment';
class CalendarContainer extends React.Component {
constructor(props: any) {
super(props);
}
render() {
const localizer = BigCalendar.momentLocalizer(moment);
return (
<>
<BigCalendar localizer={localizer} events={events} />
</>
);
}
}
export default CalendarContainer;
code
that has generated the error? – dance2die