Material-ui: [material-ui-icons] Icons have no TS typings

Created on 12 Sep 2017  路  4Comments  路  Source: mui-org/material-ui


The icons from material-ui-icon have no TS typings, so there's no way to import them without getting a (Could not find a declaration module for module FOOBAR) warning.
The only workaround is to use an old const AddIcon = require('material-ui-icons/Add').default;

  • [X] I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior


Icons from the package should have a typing so TS doesn't generate a warning when importing them.

Current Behavior


Importing them generates a TS warning, having to resort to require

Steps to Reproduce (for bugs)


import AddIcon from 'material-ui-icons/Add';

Your Environment

| Tech | Version |
|--------------|---------|
| Material-UI | 1.0-beta9 |
| React | 15 |
| browser | Chrome 61 |
| TS | 2.5.2 on strict mode |

typescript

Most helpful comment

@sebald I will cut a release this evening.

All 4 comments

In the currently released version there is only an index.d.ts. IMHO a new release should resolve this.

@oliviertassinari I noticed this to, but just imported from index for now. Do you have time to cut a new release?

@sebald I will cut a release this evening.

https://media.giphy.com/media/3o6Zt6KHxJTbXCnSvu/giphy.gif

Published 馃帀

Was this page helpful?
0 / 5 - 0 ratings

Related issues

newoga picture newoga  路  3Comments

anthony-dandrea picture anthony-dandrea  路  3Comments

revskill10 picture revskill10  路  3Comments

sys13 picture sys13  路  3Comments

activatedgeek picture activatedgeek  路  3Comments