Skip to content

Conversation

@manoj-malviya-96
Copy link

This pull request introduces performance improvements and new customization options to the calendar components. The main focus is on optimizing rendering through React hooks like useMemo and useCallback, and adding flexibility to the CalendarList component by allowing dynamic control over page height and number of pages. These changes help reduce unnecessary recalculations and re-renders, making the calendar more efficient and easier to configure.

Performance and rendering optimizations

  • Refactored the Calendar component to use useMemo and useCallback for rendering days, weeks, months, and header, minimizing unnecessary recalculations and improving performance. (src/calendar/index.tsx) [1] [2] [3] [4] [5] [6]
  • Updated the style recalculation to respond to theme changes using useEffect, ensuring styles are always up-to-date when the theme changes. (src/calendar/index.tsx)

Customization and prop handling

  • Added new props calendarHeight and numberOfPages to CalendarListProps, allowing dynamic control of calendar page height and the number of pages displayed. (src/calendar-list/new.tsx)
  • Modified CalendarList to use the new props for pageHeight and onReachNearEdgeThreshold, making the component more flexible for different use cases. (src/calendar-list/new.tsx)

Prop extraction and usage fixes

  • Fixed header prop extraction in CalendarList to use calendarProps instead of all props, ensuring correct prop usage for header rendering. (src/calendar-list/new.tsx)
  • Removed redundant spreading of headerProps into the Calendar component, relying on direct prop passing and memoized extraction. (src/calendar-list/new.tsx)

Gesture handling

  • Memoized gesture props and callbacks in the Calendar component, improving swipe handling and preventing unnecessary re-renders. (src/calendar/index.tsx) [1] [2]

These changes collectively improve the efficiency, maintainability, and configurability of the calendar components.

@manoj-malviya-96 manoj-malviya-96 force-pushed the manoj/new_calendar_list branch 2 times, most recently from 78a3778 to 9dc3ee3 Compare January 2, 2026 14:44
@manoj-malviya-96 manoj-malviya-96 force-pushed the manoj/new_calendar_list branch from 9dc3ee3 to d378076 Compare January 2, 2026 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant