Version 5 of React GitHub Calendar introduces several breaking changes and a introduces a new approach to tooltips. Because this component supports all props of the underlying calendar component React Activity Calendar, all breaking changes from React Activity Calendar v3 also apply here.
Breaking changes
- React GitHub Calendar is now a pure ESM package.
- The default export has been removed. Use the named export instead:
import { GitHubCalendar } from 'react-github-calendar'
- The
eventHandlersprop has been removed. Use therenderBlockprop withReact.cloneElement()to attach
event handlers - The
totalCountprop has been removed, overriding the total count is no longer supported. - The
transformTotalCountprop has been removed, overriding the total count is no longer supported. - The
hideColorLegendprop has been renamed toshowColorLegend. - The
hideMonthLabelsprop has been renamed toshowMonthLabels. - The
hideTotalCountprop has been renamed toshowTotalCount.
Tooltips
Tooltips no longer depend on external libraries and are now integrated directly into the calendar package. Thanks to code-splitting, tooltips only affect your bundle size when you use them. They are implemented using the Floating UI library as a “headless” component, meaning they come without predefined styles. This gives you full control over the appearance:
- Import the default styles provided by React Activity Calendar, or
- Add your own custom CSS.
See the tooltips documentation of the calendar component for details and examples.