--- sidebar_position: 5 --- # Upgrading to v9 This release includes important updates related to accessibility, styles, internationalization and performance. See the [changelog](./changelog.mdx) for the full list of changes. #### Upgrading from v7 If you are upgrading from v7, this guide is still valid for you. Read first the [migration guide from v7 to v8](../versioned_docs/version-8.10.1/upgrading.mdx) and then follow the steps below. ## Checklist ### 1. Upgrade to the latest version ```bash npm2yarn npm install react-day-picker@latest ``` Remove `date-fns` from your dependencies if you are not using it directly in your code, like when using a [different locale](./docs/localization.mdx). ```bash npm2yarn npm remove date-fns ``` ### 2. Update your custom styles The default design is slightly changed, so you may need to adjust DayPicker again to match your design. See the [styling docs](./docs/styling.mdx) for more information. ### 3. Update the class names This version updates the name of the [UI elements](./api/enumerations/UI.md) to be more clear and consistent, so the class names have changed. If you are using custom styles via `classNames` or `styles` prop, you will need to update some of them. For example, `day_disabled` is now `disabled`: ```diff ``` Please note that the `day` element is now `day_button`, and that the `cell` element is now `day`: ```diff ``` See the following list of updated class names. The [`DeprecatedUI`](./api/type-aliases/DeprecatedUI.md) type lists all the deprecated class names.
**List of updated `ClassNames`** | Old Name | New Name | | --------------------- | ---------------------------------------------------------- | | `button` | `button_previous`, `button_next` | | `button_reset` | `button_previous`, `button_next` | | `caption` | `month_caption` | | `caption_between` | Removed | | `caption_dropdowns` | `dropdowns` | | `caption_end` | Removed | | `caption_start` | Removed | | `cell` | `day` – ⚠️ The previous `day` element is now `day_button`. | | `day_disabled` | `disabled` | | `day_hidden` | `hidden` | | `day_outside` | `outside` | | `day_range_end` | `range_end` | | `day_range_middle` | `range_middle` | | `day_range_start` | `range_start` | | `day_selected` | `selected` | | `day_today` | `today` | | `dropdown_icon` | `chevron` | | `dropdown_month` | `months_dropdown` | | `dropdown_year` | `years_dropdown` | | `head` | Removed | | `head_cell` | `weekday` | | `head_row` | `weekdays` | | `multiple_months` | Removed. Use `data-multiple-months` data attribute. | | `nav_button` | `button_previous`, `button_next` | | `nav_button_next` | `button_next` | | `nav_button_previous` | `button_previous` | | `nav_icon` | `chevron`, `button_next`, `button_previous` | | `row` | `week` | | `table` | `month_grid` | | `tbody` | `weeks` | | `tfoot` | `footer` | | `vhidden` | Removed | | `weeknumber` | `week_number` | | `with_weeknumber` | Removed. Use `data-week-numbers` data attribute. |
### 4. Remove use of `fromDate`, `toDate` In case you are using `fromDate` or `toDate`, replace them with the `hidden` and `startMonth`, `endMonth` prop. | Removed prop | Notes | | ------------ | ------------------------------------------------------------------------------------------------------------- | | ~`fromDate`~ | Replace it with `startMonth` and the `hidden` prop and the `before` [Matcher](./api/type-aliases/Matcher.md). | | ~`toDate`~ | Replace it with `endMonth` the `hidden` prop and the `after` [Matcher](./api/type-aliases/Matcher.md). | #### Example To replace `fromDate`: ```diff