Calendar next is not working
ForestLee0513 opened this issue · comments
Woolim Lee commented
I try create next button in tui calendar and material-ui-core.
but I applied handleClickNextButton, It shows me TypeError: Cannot read property 'getInstance' of undefined
here's my calendar code.
...
calendarRef = () => React.createRef();
handleClickNextButton = () => {
const calendarInstance = this.calendarRef.current.getInstance();
calendarInstance.next();
};
...
render(){
return(
<Button className={classes.changeBtn} onClick={this.handleClickNextButton}>
<ChevronRightIcon />
</Button>
<Calendar
week={timeLimit}
month={monthConfig}
view="month"
theme={themeConfig}
taskView={false}
usageStatistics={false}
isReadOnly={true}
schedules={care.flat(1)}
calendarRef={React.createRef()}
/>
)
}