Skip to content

initialMonth should not update after first mounted #169

@willmcclellan

Description

@willmcclellan

I'm not sure if this is the intended behaviour, but I expected the initialMonth property to only be relevant on the first mount of the component. So you set an initialMonth but subsequent renders ignore it.

The current behaviour here:

https://github.com/gpbl/react-day-picker/blob/master/src/DayPicker.js#L80-L84

... updates the current month to the initialMonth when receiving props which, if you aren't storing/updating the current month in state when clicking next/prev, means the months don't switch if initialMonth is always the same value.

If that is the intended behaviour, then maybe the naming of initialMonth should be changed as it doesn't fit with how it actually works?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions