Rudeg / react-input-calendar

http://rudeg.github.io/react-input-calendar/
MIT License
139 stars 94 forks source link

onChange does not work with this.props.dispatch({}) #105

Closed Dancyg closed 6 years ago

Dancyg commented 7 years ago

onChange does not work with this.props.dispatch({})" onChange={this.props.dispatch({type, payload})} doesn't cause changes of the local state of the Calendar component - so I cannot change nor date in the input neither month. Could it be caused by the changeing of the "this" context?

Dancyg commented 7 years ago

The problem with with props.date. It was set to date={new Date()}. Changed to date={this.props.date} - now it works with this.props.dispatch({type:"SOME_TYPE", date: variable})