Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(types): deprecations and updated type names #2138

Merged
merged 39 commits into from
May 24, 2024
Merged

feat(types): deprecations and updated type names #2138

merged 39 commits into from
May 24, 2024

Conversation

gpbl
Copy link
Owner

@gpbl gpbl commented May 17, 2024

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 53a1c6c
DayPickerDefaultProps PropsDefault 81439e7
DayPickerSingleProps PropsSingle 81439e7
DayPickerMultipleProps PropsMulti 81439e7
DayPickerRangeProps PropsRange 81439e7
WeekNumber WeekNumberRowHeader 280f552
Row WeekRow aeff9ab
HeadRow WeekdaysRow b6302b1
Caption MonthCaption 4d3e967
Month MonthGrid d2b962e
Root Calendar bf33538
RootProviderProps ContextProvidersProps d58410f
RootProvider ContextProviders f868d8a

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 (2bad3c3)

@gpbl gpbl changed the title v9 - new types feat!: updated types May 17, 2024
@gpbl gpbl changed the title feat!: updated types feat!: updated types and deprecations May 17, 2024
@gpbl gpbl added the Type: Refactoring A code change that neither fixes a bug nor adds a feature label May 17, 2024
@gpbl gpbl changed the title feat!: updated types and deprecations feat(types): deprecations and updated type names May 24, 2024
@gpbl gpbl marked this pull request as ready for review May 24, 2024 10:56
@gpbl gpbl merged commit da73d32 into main May 24, 2024
12 checks passed
@gpbl gpbl deleted the v9-new-types branch May 24, 2024 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Refactoring A code change that neither fixes a bug nor adds a feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant