I try to use material-ui v5, but I found the AppBar
has a problem to get theme, so it doesn't show any color.
sandbox: https://codesandbox.io/s/material-uiappbar-roquc?file=/src/App.tsx:111-403
export default function App() {
return (
<div className="App">
<AppBar color="primary" position="static">
<Toolbar>I am AppBar! Where is my color?</Toolbar>
</AppBar>
<Button color="primary" variant="contained">
color
</Button>
</div>
);
}
In this example:
- The
AppBar
can not get default theme color, but theButton
can get the default theme color. - If you change the material-ui to
v4
, then it is all right.
Do you know, what's wrong in my code? Or there is something changed in V5?