question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Typescript compilation error in KeyboardDatePicker

See original GitHub issue

image

Environment

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

  1. Import latest versions of the above
  2. Include a KeyboardDateInput component
  3. 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:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
oliviertassinaricommented, May 2, 2019

Upgrading from @types/react@16.8.10 to @types/react@16.8.15 solves the problem for me too.

1reaction
dmtrKovalenkocommented, May 1, 2019

I suppose you have outdated @types/react

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found