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

[Pickers] Remove dateAdapter prop #25162

Merged
merged 2 commits into from
Mar 3, 2021

Conversation

eps1lon
Copy link
Member

@eps1lon eps1lon commented Mar 2, 2021

BREAKING CHANGE

  • [Pickers] Remove the dateAdapter prop. The prop didn't solve any important problem better than any of its alternatives do.
-<DatePicker dateAdapter={x} />
+<LocalizationProvider dateAdapter={x}>
+  <DatePicker />
+</LocalizationProvider>

It's just sugar around adding another provider. But it makes implementation and interface (DatePicker becomes polymorphic due to dateAdapter) harder to reason about.

Closes #23670

@eps1lon eps1lon added breaking change component: pickers This is the name of the generic UI component, not the React module! labels Mar 2, 2021
@mui-pr-bot
Copy link

mui-pr-bot commented Mar 2, 2021

@material-ui/lab: parsed: -0.14% 😍, gzip: -0.08% 😍

Details of bundle changes

Generated by 🚫 dangerJS against 3d8c8d9

@eps1lon eps1lon marked this pull request as ready for review March 2, 2021 17:33
@eps1lon eps1lon requested a review from oliviertassinari March 2, 2021 17:34
@eps1lon
Copy link
Member Author

eps1lon commented Mar 2, 2021

@oliviertassinari Fixed a typo in the breaking change explainer

Comment on lines +5 to +7
export interface AllSharedPickerProps<TInputValue = any, TDateValue = any>
extends BasePickerProps<TInputValue, TDateValue>,
ExportedDateInputProps<TInputValue, TDateValue> {}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

drive-by refactoring from type to interface.

@oliviertassinari oliviertassinari changed the title [pickers] Remove dateAdapter prop [Pickers] Remove dateAdapter prop Mar 2, 2021
@eps1lon eps1lon merged commit 5ac8d66 into mui:next Mar 3, 2021
@eps1lon eps1lon deleted the feat/pickers/remove-date-adapter branch March 3, 2021 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change component: pickers This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[DatePicker] Remove the dateAdapter prop
3 participants