Skip to content

Upgrade guide from version 2.x to 3.x

Wojciech Maj edited this page Mar 9, 2020 · 6 revisions

React <16.3 is not supported

To make development of new features easier, React-Calendar 3.x drops support for React 15.x and older versions of React 16. You will need to upgrade to at least React 16.3 to be able to use React-Calendar 3.x.

Styles are no longer included by default

React-Calendar used to import required CSS automatically. This proven to be confusing to our users both because they got unexpected errors about CSS (like Unexpected token .), and because it was hard to import React-Calendar without the default styles. If you'd like to continue using default styles, check README instructions on custom styling.

Typings are no longer shipped with React-Calendar package

React-Calendar 3.x no longer ships with typings. We're currently looking for contributors willing to migrate them to DefinitelyTyped. Read more.

formatMonth and formatMonthYear functions will now be used more broadly

Functions passed as formatMonth, formatMonthYear (along with a newly added formatYear) props are now used for tile rendering as well. Previously, they were only meant for Navigation component title bar. This means that if you used these functions to push additional text to Navigation component title bar, in React-Calendar 3.x it will affect the tiles, too.

onActiveDateChange was renamed to onActiveStartDateChange

For better clarity on what this onActiveDateChange callback is for, it got renamed to onActiveStartDateChange for it to be in line with activeStartDate prop.

"Now" tiles have new default styling

"Now" tiles (current day/month/year/decade…) have new default styling with yellow highlight. If you don't want the new highlight, remove it using by applying your own styling to .react-calendar__tile--now class.