What changed in React DayPicker from 9 to 10
3 releases numbered after v9.14.0 up to and including v10.0.2, stable releases only. v9.14.0 and v10.0.2 are the newest stable releases of 9 and 10 we track; this page follows them as new ones ship.
- 1 mentions breaking changes
- 1 removes or deprecates something
24 changes across 3 releases
- New @daypicker/react package name is available and preferred for new projects, while react-day-picker remains available for compatibility
- Non-Gregorian calendars are published as standalone @daypicker/* packages, including persian, hebrew, buddhist, ethiopic, and hijri
- The amET locale export moved to @daypicker/ethiopic
- Preserve focus when controlled month changes replace the focused day
- Import date-fns functions and DayPicker locales from their subpaths
- Avoid loading all date-fns locales when importing a locale subpath
- Preserve focus when controlled month changes replace the focused day in @daypicker/react
- Import date-fns functions and DayPicker locales from their subpaths in @daypicker/react
- Avoid loading all date-fns locales when importing a locale subpath in @daypicker/react
- Import date-fns functions and DayPicker locales from their subpaths in @daypicker/buddhist
- Import date-fns functions and DayPicker locales from their subpaths in @daypicker/ethiopic
- Import date-fns functions and DayPicker locales from their subpaths in @daypicker/hebrew
- Import date-fns functions and DayPicker locales from their subpaths in @daypicker/hijri
- Apply inline styles to all component slots
- Add @types/react as an optional peer dependency
- Dropdown navigation in multi-month calendars now shows the expected month when changing month or year
- Deprecated navigation props fromMonth, fromYear, toMonth, toYear, fromDate, and toDate are removed in favor of startMonth, endMonth, and hidden
- Deprecated focus and event props initialFocus and onWeekNumberClick, onDayKeyUp, onDayKeyPress, onDayPointerEnter, onDayPointerLeave, onDayTouchCancel, onDayTouchEnd, onDayTouchMove, and onDayTouchStart are removed in favor of autoFocus, a custom WeekNumber component, or a custom DayButton component
- Deprecated aliases formatMonthCaption, formatYearCaption, labelDay, labelCaption, isMatch, and isDateInRange are removed in favor of formatCaption, formatYearDropdown, labelDayButton, labelGrid, dateMatchModifiers, and rangeIncludesDate
- Deprecated type exports from types/deprecated are removed
- Deprecated components.Button customization entry is removed in favor of PreviousMonthButton and NextMonthButton
- Deprecated DeprecatedUI compatibility typing for classNames and styles is removed
- Deprecated DateLib exports FormatOptions, LabelOptions, dateLib, and DateLib.Date are removed
- Deprecated react-day-picker/jalali subpath is removed in favor of the Persian calendar package
Original release notes, newest first
The list above is our reading of these notes; the originals from gpbl are here, one fold per release.
v10.0.2
What's Changed
react-day-picker
- fix: preserve focus when controlled month changes replace the focused day. #3010 by @gpbl
- fix: import date-fns functions and DayPicker locales from their subpaths #3020 by @amanokh
- fix: avoid loading all date-fns locales when importing a locale subpath. #3007 by @huuyafwww
@daypicker/react
- fix: preserve focus when controlled month changes replace the focused day. #3010 by @gpbl
- fix: import date-fns functions and DayPicker locales from their subpaths #3020 by @amanokh
- fix: avoid loading all date-fns locales when importing a locale subpath. #3007 by @huuyafwww
@daypicker/buddhist
@daypicker/ethiopic
@daypicker/hebrew
@daypicker/hijri
v10.0.1
What's Changed
- fix: apply inline styles to all component slots by @gpbl in https://github.com/gpbl/react-day-picker/pull/2995
- fix: add @types/react as optional peer dependency by @mrmckeb in https://github.com/gpbl/react-day-picker/pull/2997
New Contributors
- @mrmckeb made their first contribution in https://github.com/gpbl/react-day-picker/pull/2997
Full Changelog: https://github.com/gpbl/react-day-picker/compare/v10.0.0...v10.0.1
v10.0.0
DayPicker v10 removes the public APIs deprecated in v9 and introduces a new @daypicker/react package name. Non-Gregorian calendars are now published as standalone @daypicker/* packages.
If your app already uses the current v9 API, the upgrade should be relatively small. If your app still relies on deprecated v9 APIs, those usages should be updated before upgrading.
See the full v10 changelog, the upgrade guide, and the v10 announcement for questions and upgrade feedback.
Install
npm install react-day-picker@latest
For new projects, prefer the scoped package name:
npm install @daypicker/react@latest
import { DayPicker } from "@daypicker/react";
import "@daypicker/react/style.css";
The react-day-picker package remains available in v10 for compatibility.
Breaking Changes
Deprecated navigation props removed
| Removed prop | Use instead |
|---|---|
fromMonth | startMonth |
fromYear | startMonth={new Date(year, 0)} |
toMonth | endMonth |
toYear | endMonth={new Date(year, 11)} |
fromDate | hidden={{ before: date }} and optionally startMonth |
toDate | hidden={{ after: date }} and optionally endMonth |
Deprecated focus and event props removed
| Removed prop | Use instead |
|---|---|
initialFocus | autoFocus |
onWeekNumberClick | A custom WeekNumber component |
onDayKeyUp | A custom DayButton component |
onDayKeyPress | A custom DayButton component |
onDayPointerEnter | A custom DayButton component |
onDayPointerLeave | A custom DayButton component |
onDayTouchCancel | A custom DayButton component |
onDayTouchEnd | A custom DayButton component |
onDayTouchMove | A custom DayButton component |
onDayTouchStart | A custom DayButton component |
Deprecated aliases removed
| Removed API | Use instead |
|---|---|
formatMonthCaption | formatCaption |
formatYearCaption | formatYearDropdown |
labelDay | labelDayButton |
labelCaption | labelGrid |
isMatch | dateMatchModifiers |
isDateInRange | rangeIncludesDate |
Other removed compatibility APIs
- Removed deprecated type exports from
types/deprecated. - Removed the deprecated
components.Buttoncustomization entry. UsePreviousMonthButtonandNextMonthButton. - Removed deprecated
DeprecatedUIcompatibility typing forclassNamesandstyles. - Removed deprecated DateLib exports:
FormatOptions,LabelOptions,dateLib, andDateLib.Date. - Removed the deprecated
react-day-picker/jalalisubpath. Use the Persian calendar package instead.
Calendar Package Changes
Non-Gregorian calendars are now published as standalone packages under the @daypicker/* scope:
npm install @daypicker/react @daypicker/persian
npm install @daypicker/react @daypicker/hebrew
npm install @daypicker/react @daypicker/buddhist
npm install @daypicker/react @daypicker/ethiopic
npm install @daypicker/react @daypicker/hijri
The amET locale export moved to @daypicker/ethiopic.
Fixes
- Fixed dropdown navigation in multi-month calendars so changing month or year shows the expected month.
What's Changed
- feat!: remove deprecated public APIs by @gpbl in #2920
- feat!: extract
@daypicker/hijriand@daypicker/persianby @gpbl in #2938 - feat!: extract
@daypicker/buddhist,@daypicker/ethiopic, and@daypicker/hebrewby @gpbl in #2939 - feat: add
@daypicker/reactas the preferred package name by @gpbl in #2970 - fix: move the
amETlocale export to@daypicker/ethiopicby @gpbl in #2968 - fix: show the expected month after dropdown changes in multi-month calendars by @hackgray47-eng in #2977
Full Changelog: https://github.com/gpbl/react-day-picker/compare/v9.14.0...v10.0.0