Typescript compilation error in KeyboardDatePicker
See original GitHub issueEnvironment
Tech | Version |
---|---|
material-ui-pickers | 3.0.0-alpha.3 |
material-ui | 4.0.0-beta.0 |
React | 16.8.2 |
Browser | Chrome |
Typescript | 3.3.3333 |
Peer library | moment 2.24.0 |
Steps to reproduce
- Import latest versions of the above
- Include a KeyboardDateInput component
- Try to compile (or view in VSCode with TS checking)
Expected behavior
Compiles / no TS errors
Actual behavior
TS errors with:
Type '{ format: string; id: string; label: Element; onChange: (date: Moment) => void; value: string; }' is missing the following properties from type 'Pick<KeyboardDatePickerProps, "open" | "onAccept" | "okLabel" | "cancelLabel" | "clearLabel" | "todayLabel" | "showTodayButton" | "clearable" | "DialogProps" | "children" | ... 312 more ... | "invalidDateMessage">': onAuxClick, onAuxClickCapturets(2739)
Live example
Alas I’m not sure how to make a live demo with a typescript error
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Typescript compilation error in KeyboardDatePicker #1017
Steps to reproduce. Import latest versions of the above; Include a KeyboardDateInput component; Try to compile (or view in VSCode with TS ...
Read more >Type error in labelFunc in KeyBoardDatePicker component ...
The error is pretty self-explanatory. The component wants to give you a MaterialUiPickersDate and you function accepts a string .
Read more >Type error in labelFunc in KeyBoardDatePicker component ...
Coding example for the question Type error in labelFunc in KeyBoardDatePicker component, Material-ui/pickers, Typescript-Reactjs.
Read more >React custom datepicker: Step-by-step - LogRocket Blog
Set up a robust and attractive datepicker in React that acts as an alternative to the native HTML5 datepicker input element.
Read more >Migration from @material-ui/pickers - MUI
-import { KeyboardDatePicker } from '@material-ui/pickers'; +import DatePicker from '@mui/lab/DatePicker'; -<KeyboardDatePicker /> +<DatePicker />
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Upgrading from
@types/react@16.8.10
to@types/react@16.8.15
solves the problem for me too.I suppose you have outdated @types/react