我使用 https://codesandbox.io/s/github/SabuShakya/React-Sidebar-Using-Material-UI/ 一个作为参考, 我想将 appbar 的背景更新为 #ffb74d,
我检查了很多答案,答案在我尝试过的其他项目中对我有用,但同样的方法在这个项目中无济于事,我不知道这里出了什么问题
以下代码是我在 MiniDrawer.js 中添加的,没有按预期运行
const theme = createMuiTheme({
palette: {
primary: {
// Purple and green play nicely together.
main: '#0fb7ae',
},
secondary: {
// This is green.A700 as hex.
main: '#11cb5f',
},
},
});
....
<ThemeProvider theme={theme}>
<AppBar
position="fixed"
color={theme.palette.primary.main}
.......
有人帮我吗?