Upgrading from v7
v8 is a mayor upgrade for DayPicker with new props and styles. We include here a quick reference for helping the upgrade from v7.
v7 is frozen
v7 is frozen and there are no plans for updating it. If you have bugs or feature requests, please consider to upgrade to v8. The legacy documentation for v7 can be found at https://react-day-picker-v7.netlify.app.
How to upgrade to v8​
- upgrade the dependency
npm install react-day-picker@latest
- remove the types package if you were using it
npm uninstall @types/react-day-picker
- update the CSS import: the stylesheet has been moved to
/dist
. For example:- import `react-day-picker/lib/style.css`
+ import `react-day-picker/dist/style.css` - update your custom styles. See Styling DayPicker for more information.
- update the changed props. See the list below.
Updated Props​
showWeekNumbers
has been renamed toshowWeekNumber
todayButton
has been removed. See Controlling the current month for an example implementing the same feature.initialMonth
has been renamed todefaultMonth
. See Navigating months for more details about usingmonth
anddefaultMonth
.canChangeMonth
has been renamed todisableNavigation
selectedDays
has been renamed toselected
. See also: Selecting Days guide.disabledDays
has been renamed todisabled
. See also: Disabling days.
DayPickerInput​
The DayPickerInput
component has been removed. If you upgrade to v8, you will need to rewrite your implementation:
- Try with useInput hook.
- See this example to build a date picker with v8 in a dialog.