Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Module '...' resolves to a non-module entity 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?

like image 871
Raul Tomescu Avatar asked Feb 08 '16 19:02

Raul Tomescu


Video Answer


1 Answers

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');
like image 66
Blake Bowen Avatar answered Oct 09 '22 09:10

Blake Bowen