DayPicker is a customizable date picker component for React. Add date pickers, calendars, and date inputs to your web applications.
5.86k
stars
701
forks
source link
feat(types): deprecations and updated type names #2138
Closed
gpbl closed 1 month ago
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 astring
. For React Nodes, a custom component should be used instead.Breaking: Renamed Previous/Next Buttons label
These will require a test update.
Deprecated Types
The following types have been renamed. The old names have been deprecated in
components/deprecated.ts
and shouldn't be used anymore.DaySelectionMode
Mode
DayPickerDefaultProps
PropsDefault
DayPickerSingleProps
PropsSingle
DayPickerMultipleProps
PropsMulti
DayPickerRangeProps
PropsRange
WeekNumber
WeekNumberRowHeader
Row
WeekRow
HeadRow
WeekdaysRow
Caption
MonthCaption
Month
MonthGrid
Root
Calendar
RootProviderProps
ContextProvidersProps
RootProvider
ContextProviders
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)