-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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] Use usePickerContext()
and usePickerActionsContext()
to get the actions in the actionBar
slot and in internal components
#15843
Conversation
Deploy preview: https://deploy-preview-15843--material-ui-x.netlify.app/ Updated pages: |
bb85508
to
77edf42
Compare
/** | ||
* Closes the picker and accepts the current value if it is not equal to the last accepted value. | ||
*/ | ||
dismissViews: () => void; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would love to get rid of this method 😬
It was never used in a public component but was part of the public API since it was passed to PickersLayout
( 🤦 ).
I'm making it private so we can modify it, remove it in the future.
*/ | ||
open: boolean; | ||
clearValue: () => void; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main thing I would like to discuss is the naming of those methods.
I tried to be consistent with setOpen
(vs onOpen
/ onClose
).
… the actions in the actionBar slot and in internal components
77edf42
to
a525f69
Compare
usePickerContext()
and usePickerActionsContext()
to get the actions in the actionBar slot and in internal componentsusePickerContext()
and usePickerActionsContext()
to get the actions in the actionBar
slot and in internal components
docs/data/migration/migration-pickers-v7/migration-pickers-v7.md
Outdated
Show resolved
Hide resolved
docs/data/migration/migration-pickers-v7/migration-pickers-v7.md
Outdated
Show resolved
Hide resolved
docs/data/migration/migration-pickers-v7/migration-pickers-v7.md
Outdated
Show resolved
Hide resolved
packages/x-date-pickers-pro/src/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.tsx
Show resolved
Hide resolved
Co-authored-by: Michel Engelen <[email protected]> Signed-off-by: Flavien DELANGLE <[email protected]>
Co-authored-by: Michel Engelen <[email protected]> Signed-off-by: Flavien DELANGLE <[email protected]>
Co-authored-by: Michel Engelen <[email protected]> Signed-off-by: Flavien DELANGLE <[email protected]>
Co-authored-by: Michel Engelen <[email protected]> Signed-off-by: Flavien DELANGLE <[email protected]>
Co-authored-by: Michel Engelen <[email protected]> Signed-off-by: Flavien DELANGLE <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nothing blocking here as well ... LGTM
docs/data/migration/migration-pickers-v7/migration-pickers-v7.md
Outdated
Show resolved
Hide resolved
docs/data/migration/migration-pickers-v7/migration-pickers-v7.md
Outdated
Show resolved
Hide resolved
docs/data/migration/migration-pickers-v7/migration-pickers-v7.md
Outdated
Show resolved
Hide resolved
docs/data/migration/migration-pickers-v7/migration-pickers-v7.md
Outdated
Show resolved
Hide resolved
packages/x-date-pickers/src/internals/hooks/usePicker/usePickerValue.types.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Michel Engelen <[email protected]> Signed-off-by: Flavien DELANGLE <[email protected]>
Co-authored-by: Michel Engelen <[email protected]> Signed-off-by: Flavien DELANGLE <[email protected]>
Co-authored-by: Michel Engelen <[email protected]> Signed-off-by: Flavien DELANGLE <[email protected]>
Co-authored-by: Michel Engelen <[email protected]> Signed-off-by: Flavien DELANGLE <[email protected]>
…rValue.types.ts Signed-off-by: Flavien DELANGLE <[email protected]>
… get the actions in the `actionBar` slot and in internal components (mui#15843) Signed-off-by: Flavien DELANGLE <[email protected]> Co-authored-by: Michel Engelen <[email protected]>
Part of #15495
Part of #16059
What?
setView
instead ofonOpen
andonClose
on all the internal componentsusePickerActionsContext()
to get the actions from the slotsusePickerActionsContext()
in all the slots (and remove the props)Why?