react-calendar

How can I disabled the view change of react-calendar?


when I click the Prev Button or Next Button, there is not any function can control it. eg: When I click the Prev Button, I want a Toast a string, AND DO NOT GO TO THE PREV VIEW. However, there is no any Function can I disabled it.

I put the issue on the github of react-calendar, but the author says I should post this on here (stack-overflow).


Solution

  • Prev/Next buttons are disabled based on minDate and maxDate. There's no way to manually disable these buttons.

    You can use onActiveStartDateChange to monitor change of "active start date" (the date currently shown view starts on). onActiveStartDateChange, since 3.5.0, will also let you know using action which action triggered the callback.