react-calendar-mobile
react-calendar-mobile copied to clipboard
Update component on change startDateAt
Hi,
I'm trying make a custom navigation between months, but I am barred, because the component not update the render when update de startDateAt prop.
Ex:
// ...
this.state = {
startAt: moment().toDate()
}
// ...
goToNextMonth() {
this.setState({
startAt: moment(this.state.startDateAt).add(1, 'months').toDate()
})
}
// ...
<Calendar
startDateAt={this.state.startAt}
decorate={this.decorates}
i18n={locale}
onSelectDate={(date) => this.handleSelect(date)}
/>
<button className='agenda-btn next' onClick={this.goToNextMonth}>{monthName} >></button>
In the console is showing the correct data, but just is not updating the component.