react-native-calendar-kit icon indicating copy to clipboard operation
react-native-calendar-kit copied to clipboard

Performance Issue with numberOfDays Prop in Day View Mode

Open basaksilasanli opened this issue 1 year ago • 0 comments

First of all, thank you for creating and maintaining such a great library! I've been using this library for my project, and I noticed a potential performance issue after upgrading to version 2.

With the introduction of the numberOfDays prop (which replaced viewMode), I’ve set numberOfDays to 1 because my project only focuses on single-day views, and I don’t use weekly or multi-day views. However, I observed that when numberOfDays is set to 1, the initial loading time of the calendar increases significantly, especially when used with the newly introduced pagesPerSide prop (default value 2).

To better understand the issue, I ran some tests:

If I increase numberOfDays to 5, the initial loading time is noticeably reduced. At the start, there are no events or unavailable hours provided in my setup. I was able to reduce the lag by setting pagesPerSide to 0, but I still don’t understand why there’s such a noticeable delay when using the day view (numberOfDays = 1).

I would appreciate it if you could look into this issue, as it might affect others who use the day view mode. Please let me know if you need more details or example code to reproduce the issue.

Thank you for your time and support!

basaksilasanli avatar Jan 09 '25 17:01 basaksilasanli