diff --git a/src/components/Calendar.tsx b/src/components/Calendar.tsx index 2b98fe0..23c3b09 100644 --- a/src/components/Calendar.tsx +++ b/src/components/Calendar.tsx @@ -35,6 +35,12 @@ class Calendar extends React.PureComponent { constructor(props: any) { super(props); this.state = {}; + + this.onNavigate = this.onNavigate.bind(this); + } + + onNavigate(currentDate: Date) { + this.setState({currentDate}); } render() { @@ -42,13 +48,11 @@ class Calendar extends React.PureComponent {
{ - this.props.onItemClick(event); - }} + onSelectEvent={this.props.onItemClick as any} formats={{agendaHeaderFormat: agendaHeaderFormat}} eventPropGetter={eventPropGetter} date={this.state.currentDate} - onNavigate={(currentDate: Date) => { this.setState({currentDate}); }} + onNavigate={this.onNavigate} />
);