Skip to content

Commit

Permalink
docs: update upgrading guide
Browse files Browse the repository at this point in the history
  • Loading branch information
gpbl committed Jun 8, 2024
1 parent ff0efe3 commit 7b9560e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions website/docs/upgrading.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ The following props have been deprecated, and will be removed in the next major
| ~`fromYear`~ | `startMonth` | Pass the first month of the year, e.g. `startMonth = new Date(2024,0)`. |
| ~`toYear`~ | `endMonth` | Pass the last month of the year, e.g. `endMonth = new Date(2024,11)`. |

### 2. Updates for ARIA labels
### 4. Updates for ARIA labels

The following ARIA labels have been updated:

Expand All @@ -64,7 +64,7 @@ You may need to update your test selectors — for example:
+ screen.getByRole('button', 'Previous Month');
```

### 3. Formatters: update to return a string
### 5. Formatters: update to return a string

The `formatters` prop now requires functions returning a `string` instead of a `ReactNode`.

Expand All @@ -75,7 +75,7 @@ If you were [using the formatters](./using-daypicker/localization.mdx#formatters
+ const MyComponent = () => <DayPicker formatters={{ caption: () => 'My caption' }} />;
```

### 4. Custom Components: update the hooks
### 6. Custom Components: update the hooks

In case you are using DayPicker hooks in your custom components, you need to update your code:

Expand All @@ -85,7 +85,7 @@ In case you are using DayPicker hooks in your custom components, you need to upd
| ~`useNavigation`~ | Renamed to [`useCalendar`](./api/functions/useCalendar.md). |
| ~`useDayPicker`~ | Removed in favor of the `Day` custom component. See [custom components guide](./advanced-guides/custom-components.mdx). |

### 5. TypeScript: check for deprecated types
### 7. TypeScript: check for deprecated types

Many typings have been deprecated in favor of clarity and shorter names. If you were using the typings, you may need to update your code or it will break in the next major version.

Expand Down

0 comments on commit 7b9560e

Please sign in to comment.