所以,我已经阅读了https://material-ui.com/style/typography/,我正在加载Roboto字体.我期待一个简单的组件,如:
const theme = createMuiTheme();
const App = () => {
return (
<MuiThemeProvider theme={theme}>
<CssBaseline />
<p>Hello world!</p>
</MuiThemeProvider>
);
};
Run Code Online (Sandbox Code Playgroud)
将使用Roboto(默认字体)设置p标签的样式.但这不会发生.如果我将代码更改为:
const theme = createMuiTheme();
const App = () => {
return (
<MuiThemeProvider theme={theme}>
<CssBaseline />
<Typography>Hello world!</Typography>
</MuiThemeProvider>
);
};
Run Code Online (Sandbox Code Playgroud)
它按预期工作.插入p标签以及排版css.我对如何使用库感到困惑: