Skip to content

fix: defer calendar navigation render warning#76

Merged
condyl merged 1 commit intomasterfrom
cb/defer-calendar-navigation-render-warning
Jan 11, 2026
Merged

fix: defer calendar navigation render warning#76
condyl merged 1 commit intomasterfrom
cb/defer-calendar-navigation-render-warning

Conversation

@condyl
Copy link
Copy Markdown
Collaborator

@condyl condyl commented Jan 11, 2026

This pull request addresses a React warning related to calling gotoDate on the calendar API during the render phase. The main improvement is deferring these calls using queueMicrotask to ensure they occur outside of React's synchronous rendering, preventing potential issues and warnings.

Improvements to calendar navigation logic:

  • Updated all instances where calendarApi.gotoDate is called to defer execution using queueMicrotask, avoiding flushSync warnings during React render.
  • Added null checks for calendarRef.current and its API to prevent runtime errors when the reference is not available. (src/components/generator/Calendar/CalendarComponent.jsx)

@condyl condyl merged commit 44d58c8 into master Jan 11, 2026
3 checks passed
@condyl condyl deleted the cb/defer-calendar-navigation-render-warning branch January 11, 2026 21:47
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