Raul Tomescu February 2016

Module '...' resolves to a non-entity module and cannot be imported using this construct

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?

Answers


Blake Bowen February 2016

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');

Post Status

Asked in February 2016
Viewed 3,219 times
Voted 6
Answered 1 times

Search




Leave an answer