react-calendar-mobile icon indicating copy to clipboard operation
react-calendar-mobile copied to clipboard

Update component on change startDateAt

Open paulomfr opened this issue 7 years ago • 0 comments

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.

paulomfr avatar Feb 09 '18 17:02 paulomfr