Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserve selectedStartDate in state on props update #239

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Nov 19, 2020

  1. Preserve selectedStartDate in state on props update

    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:
    
    onefinestay#224
    onefinestay#203
    
    This issue will arise when the onSelectStart callback in the parent component does something that leads to changes in prop values passed into <DateRangePicker>, which will lead to `selectedStartDate` in state to be reset. Keeping selectedStartDate whatever value it was in componentWillReceiveProps will fix this issue.
    wheywu committed Nov 19, 2020
    Configuration menu
    Copy the full SHA
    f8cbc5f View commit details
    Browse the repository at this point in the history