-
Notifications
You must be signed in to change notification settings - Fork 832
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
Types require onChange to be defined #1575
Comments
Closing as invalid |
@dmtrKovalenko I believe that:
So, I think that removing such a requirement would help |
@oliviertassinari I cannot agree with that,
|
@dmtrKovalenko What's your take on 1.? |
Make |
@dmtrKovalenko From my perspective, it's nor ours call to make, it would be best to stick to the typing (prop-types) React uses for its input. onChange isn't required? Fine, so shouldn't it be for @material-ui/core nor @material-ui/lab, etc. |
@oliviertassinari f9r text-field maybe. For |
Sorry for my bad with
@dmtrKovalenko I don't fully agree with this. If the |
In our case, the prop types and TypeScript types should match, right? |
Yes and proptype for onChange in picker should be required Can’t agree about only type information. I think that we must force users to avoid mistakes |
@dmtrKovalenko In my opinion, it should be a linter that enforces |
Environment
Steps to reproduce
Use
KeyboardDatePicker
without definingonChange
,onBlur
oronFocus
:Expected behavior
No error messages (
onChange
,onBlur
andonFocus
should be optional).Actual behavior
Error Message when only
onChange
missing:Error Message when only
onBlur
missing:Error Message when only
onFocus
missing:Live example
https://codesandbox.io/s/elated-platform-swzeq
The text was updated successfully, but these errors were encountered: