Currently, in componentWillReceiveProps, we always set selectedStartDate to be null. This can lead to buggy behavior when selectedStartDate was already set to something, as alluded to in these issues:
This issue will arise when the onSelectStart callback in the parent component does something that leads to changes in prop values passed into , which will lead to selectedStartDate in state to be reset. Keeping selectedStartDate whatever value it was in componentWillReceiveProps will fix this issue.
Currently, in
componentWillReceiveProps
, we always setselectedStartDate
to be null. This can lead to buggy behavior when selectedStartDate was already set to something, as alluded to in these issues:https://github.com/onefinestay/react-daterange-picker/issues/224 https://github.com/onefinestay/react-daterange-picker/issues/203
This issue will arise when the onSelectStart callback in the parent component does something that leads to changes in prop values passed into, which will lead to
selectedStartDate
in state to be reset. Keeping selectedStartDate whatever value it was in componentWillReceiveProps will fix this issue.