Material-ui-pickers: DateTextField definition causes typescript compilation to fail

Created on 8 Oct 2018  路  8Comments  路  Source: mui-org/material-ui-pickers

Environment

| Tech | Version |
|---------------------|---------|
| material-ui-pickers | rc17 (also tested with rc14 -> same result) |
| material-ui | 3.2.0 |
| typescript | 3.1.1 |
| React | |
| Browser | |
| Peer library | |

Steps to reproduce

  1. Install 3.2.0 of material-ui/core package.
  2. Install material-ui-pickers.
  3. Build with typescript (npm start / npm run build)

Expected behavior


Build is successful, like with previous versions of material-ui/core

Actual behavior

Failed to compile.

/***/node_modules/material-ui-pickers/_shared/DateTextField.d.ts
(7,45): An interface may only extend a class or another interface.

For me it seems to be an issue with extending the Omit type. But this is not allowed in TypeScript and therefore fails to compile. Moreover I wondered why this Omit is used at all, because in the comment it is declared as an @internal type definition. I think it should not be used in an external library then.

Most helpful comment

How I temporary fixed it:

  1. Run Typescript with "tsc --skipLibCheck"
  2. (Optional) Add // @ts-ignore above a property, if it is not defined

All 8 comments

Same Problem

Same Here

When do you expect a release for that ?

How I temporary fixed it:

  1. Run Typescript with "tsc --skipLibCheck"
  2. (Optional) Add // @ts-ignore above a property, if it is not defined

I have same problem. After update "@material-ui/core": "3.2.2"

This will be fixed in #695

What version of material-ui-pickers was this bug introduced in? I'd rather just revert back to an older, working version for now.

@bheklilr this is a breaking/incompatible type change in @material-ui/core, not this, so you need to downgrade that to < 3.2.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

danmce picture danmce  路  3Comments

harvitronix picture harvitronix  路  3Comments

basselAhmed picture basselAhmed  路  3Comments

sakulstra picture sakulstra  路  3Comments

killjoy2013 picture killjoy2013  路  3Comments