Created
November 11, 2017 17:12
-
-
Save hpneo/7bf3f351cfdd1efb9f0a92e331313fbb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react'; | |
| import FullCalendar from 'fullcalendar'; | |
| class ReactFullCalendar extends React.Component { | |
| componentDidMount() { | |
| this.widget = $(this.container).fullCalendar({ | |
| currentDate: this.props.currentDate, | |
| }); | |
| this.widget.on('dateSelected', this.props.onDateSelected); | |
| } | |
| componentDidUpdate() { | |
| this.widget = $(this.container).fullCalendar({ | |
| currentDate: this.props.currentDate, | |
| }); | |
| } | |
| componentWillUnmount() { | |
| this.widget.fullCalendar('destroy'); | |
| } | |
| render() { | |
| return <div ref={(div) => {this.container = div;}} />; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment