1import interactionPlugin from "@fullcalendar/interaction"; // needed for dayClick
2
3export default class DemoApp extends React.Component {
4
5 render() {
6 return (
7 <FullCalendar dateClick={this.handleDateClick} plugins={[ dayGridPlugin, interactionPlugin ]} />
8 )
9 }
10
11 handleDateClick = (arg) => { // bind with an arrow function
12 alert(arg.dateStr)
13 }
14
15}
16
1@import '~@fullcalendar/core/main.css';
2@import '~@fullcalendar/daygrid/main.css';
3
1import React from 'react'
2import FullCalendar from '@fullcalendar/react'
3import dayGridPlugin from '@fullcalendar/daygrid'
4
5import './main.scss' // webpack must be configured to do this
6
7export default class DemoApp extends React.Component {
8
9 render() {
10 return (
11 <FullCalendar defaultView="dayGridMonth" plugins={[ dayGridPlugin ]} />
12 )
13 }
14
15}
16