Closed jordyortega closed 4 years ago
It looks like changing the selectedStartDate
prop triggers the onDateChange
callback. If your goToDate()
method updates state.selectedDate, it would trigger another cycle and loop forever. You should put logic in your goToDate()
which checks whether the date is the same, and not update state if that's the case.
I have a button seperate from the calendarPicker which can go to the next day and previous day. so today is 2019-9-21. If I click the button it goes to 2019-9-22, then to 23 and so on.
How do I update the CalendarPicker to have the prop
selectedStartDate
as the date I have chosen seperated from CalendarPicker?Because if I do this:
I get Maximum state update error.