react-day-picker
react-day-picker copied to clipboard
feat!: updated types and deprecations
In this PR, I'm updating the types to make them more consistent to the next version of react-day-picker.
Breaking: Formatters
Formatters were not meant to return a ReactNode
but a string
. For React Nodes, a custom component should be used instead.
- Formatters: always return strings (39613f1)
- Note: this change may be reverted. Let see how other devs are reacting.
Breaking: Renamed Previous/Next Buttons label
These will require a test update.
- "Go to next month" has been renamed to "Next Month"
- "Go to previous month" has been renamed to "Previous Month"
- "Week n. ${week}" renamed to "Week ${week}"
Deprecated Types
The following types have been renamed. The old names have been deprecated in components/deprecated.ts
and shouldn't be used anymore.
Deprecated Name | New Name | Commit |
---|---|---|
DaySelectionMode |
Mode |
53a1c6cf |
DayPickerDefaultProps |
PropsDefault |
81439e74 |
DayPickerSingleProps |
PropsSingle |
81439e74 |
DayPickerMultipleProps |
PropsMulti |
81439e74 |
DayPickerRangeProps |
PropsRange |
81439e74 |
WeekNumber |
WeekNumberRowHeader |
280f5520 |
Row |
WeekRow |
aeff9abe |
HeadRow |
WeekdaysRow |
b6302b1a |
Caption |
MonthCaption |
4d3e9677 |
Month |
MonthGrid |
d2b962ee |
Root |
Calendar |
bf335389 |
RootProviderProps |
ContextProvidersProps |
d58410fd |
RootProvider |
ContextProviders |
f868d8a6 |
Custom Components
Instead of adding manually the custom components, they are now exported in custom-components.ts
. The type is now defined using the exports.
-
CustomComponents
: define type using exports (2bad3c3a)