【发布时间】:2022-11-10 19:41:24
【问题描述】:
现在 Typography 变体是内联的,如下所示:
<Typography variant="h6">
Any text
</Typography>
如果样式排版如下所示,则变体实际上并没有生效。请问为什么它不起作用?代码应该是什么样子?谢谢。
const StyledTypography = styled(Typography)(({ theme }) => ({
variant: theme.typography.h6,
}));
<StyledTypography>
Any text
</StyledTypography>
【问题讨论】:
标签: material-ui variant typography