-
-
Notifications
You must be signed in to change notification settings - Fork 732
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
initialMonth should not update after first mounted #169
Comments
Yes I believe you are right, implementers should use the |
I'm not happy about that change. How would i now be able to (re)render the calendar, when my date variable in my store changes? |
@davidspiess you can use the |
@gpbl yes it works that way, but i think it should be a prop like it was. When my state changes, i want my UI to reflect that. With this behavior have to call a method when this is the case, which goes against the whole purpose of react. |
@davidspiess the problem lies in the prop's name: people expect I think i should add a new |
That would be awesome! 👍 |
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?The text was updated successfully, but these errors were encountered: