Skip to content

Instantly share code, notes, and snippets.

@arshaw

arshaw/ref-example.jsx

Last active Mar 26, 2019
Embed
What would you like to do?
class MyApp extends Component {
fullCalendar = React.createRef()
render() {
return (
<div>
<button onClick={ this.handleNext }>goto next</button>
<FullCalendar ref={ this.fullCalendar } />
</div>
)
}
handleNext = () => {
let calendarApi = this.fullCalendar.current.getApi()
calendarApi.next()
}
}
@joshuaRuff

This comment has been minimized.

Copy link

@joshuaRuff joshuaRuff commented Mar 26, 2019

I like it, feels really clean.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment