-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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] Improve PickerValidDate
type
#14771
Conversation
PickerValidDate
Deploy preview: https://deploy-preview-14771--material-ui-x.netlify.app/ Updated pages: |
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.
Nice improvement! 🙌 💯
PickerValidDate
PickerValidDate
type
@LukasTy how would you handle the doc section? Maybe we can let it as is and during the alpha we re-word it to remove the "error" aspect and just present how to correctly type if people have a "any" as the date type. |
What do you think about updating the second paragraph of the doc section to reflect these new changes in this PR? 🤔 If you see `value` or other similar props typed as `any` it means that there is no `LocalizationProvider` with a defined adapter in your TypeScript project scope.
You can fix it by manually importing the adapter in some file of your project as follows: |
Oh, that's not the best DX if it's not that clear. 🙈 Well, if we can't improve this behavior, then indeed, your suggestion with code examples makes sense. 👍 |
The other solution I see is to remove the This is typing breaking change, but one I'm totally willing to make 👍 |
That sounds great. Can we do this for v8? 🤔 |
Sure |
@LukasTy are you good merging this PR as is or do you think we should keep it for v8 and the typing changes ? |
WDYT about the documentation situation? |
👍 Right, I'll update the doc |
I tried to add some explanation on the doc 👍 |
2529d4e
to
5391aea
Compare
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.
Superb improvement on doc! 👍 💯
Signed-off-by: Flavien DELANGLE <[email protected]>
Fixes #14765
If no adapter has registered a date type in
PickerValidDate
, then we fallback toany
instead ofnever
.