【发布时间】:2018-09-07 04:48:38
【问题描述】:
我有一个使用 MUI 的反应应用程序。导入按钮时,可以使用primary={true} 或secondary={true} 设置其样式。我想更改primary 和secondary 颜色。我发现我可以这样做:
const theme = createMuiTheme({
palette: {
primary: '#00bcd4',
secondary: '#ff4081'
}
});
然后在这里我可以使用它:
<MuiThemeProvider theme={theme}>
<App/>
</MuiThemeProvider>
但我收到一个错误:createMuiTheme is not a function...
我进入MUI包发现没有这样的文件,当我导入createMuiTheme时,我得到undefined。它应该是从material-ui/styles/theme 导入的,但它实际上根本没有这个文件夹!
我使用的是material-ui@0.19.4。我将这个包更新为v20,但仍然没有这样的文件夹。
【问题讨论】:
标签: reactjs material-ui material-design themes