问题
I have a .tsx file in which I am trying to import a RaisedButton component from material-ui like so:
import * as RaisedButton from 'material-ui/lib/raised-button'
However, that gives me the error described in the title, any ideas what I might be doing wrong?
回答1:
This is from the material-ui.d.ts
file.
export import RaisedButton = __MaterialUI.RaisedButton; // require('material-ui/lib/raised-button');
So you should import it like this.
import RaisedButton = require('material-ui/lib/raised-button');
来源:https://stackoverflow.com/questions/35277354/module-resolves-to-a-non-module-entity-and-cannot-be-imported-using-this-c