Material-ui: [Typescript] Button type attribute typing needs to be updated

Created on 27 Mar 2019  ·  3Comments  ·  Source: mui-org/material-ui

The typings for the type attribute on Button no longer matches the typing in @types/react since commit: https://github.com/DefinitelyTyped/DefinitelyTyped/commit/4d371be185ddd77264a8d7f30a7f7f8912738ed8

bug 🐛 typescript

Most helpful comment

Released as v3.9.3.

All 3 comments

The problem surfaced because of a change in @types/react: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/34194. To prevent the issue either pin @types/react to a previous version or use a fork of Button.d.ts with paths alias.

Released as v3.9.3.

@oliviertassinari Is there an example somewhere of how to properly override with the paths option from tsconfig.json?

Currently doing this:

"paths": {
    "@material-ui/core/*": ["typings/@material-ui/core/*"]
 }

...

src/typings
└── @material-ui
    └── core
        └── Button
            ├── Button.d.ts
            ├── Button.js
            ├── index.d.ts
            └── index.js

but have a feeling I have done something wrong.

We are on a very old version of @material-ui/core, otherwise I would just upgrade.

Was this page helpful?
0 / 5 - 0 ratings