【发布时间】:2021-05-19 01:52:52
【问题描述】:
我正在尝试使用以下内容来设置 MaterialUI Typography 组件的样式:
const StyledTitleTypography = styled(Typography)`
color: 'black';
font-weight: 'bold';
`;
<StyledTitleTypography variant="h6" noWrap>
test
</StyledTitleTypography>
但是,当我直接设置样式时,它可以工作
<Typography variant="h6" noWrap style={{ color: 'black', fontWeight: 'bold' }}>
test
</Typography>
如果有人在外面...here's 与emotion 和styled-components 一起演示的堆栈闪电
【问题讨论】:
标签: css reactjs material-ui styled-components emotion