React Material UI:导入某些组件后出错

时间:2016-08-22 14:15:56

标签: javascript reactjs material-ui

我尝试了不同的Material UI组件。非常非常基本的东西。

我的代码:

import React from 'react';
import ReactDOM from 'react-dom';
import injectTapEventPlugin from 'react-tap-event-plugin';

import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
import FlatButton from 'material-ui/FlatButton';

injectTapEventPlugin();

const App = () => (
<MuiThemeProvider>
    <div>
        <FlatButton label="Default" />
        <FlatButton label="Primary" primary={true} />
        <FlatButton label="Secondary" secondary={true} />
        <FlatButton label="Disabled" disabled={true} />
    </div>
</MuiThemeProvider>
);


ReactDOM.render(<App />, document.getElementById('app'));

它没有任何问题。但是,如果我添加菜单组件

///...///
import FlatButton from 'material-ui/FlatButton';
import Menu from 'material-ui/Menu';
import MenuItem from 'material-ui/MenuItem';

injectTapEventPlugin();
///...///

我在浏览器中看到未捕获的TypeError:wrapDisplayName不是函数,一切都坏了。

0 个答案:

没有答案