【发布时间】:2021-09-19 11:59:52
【问题描述】:
在 StackOverflow 中找不到任何相关问题。
所以,在 box 组件中,sx prop 正在被转换,比如从
<Box
sx={{
display: 'flex',
flexDirection: 'column',
height: '100%'
}}
>
到
<div class="MuiBox-root MuiBox-root-371"/>
但它不会在 ListSubheader 等其他组件中进行转换
<ListSubheader
disableGutters
disableSticky
sx={{
color: 'text.primary',
fontSize: '0.75rem',
lineHeight: 2.5,
fontWeight: 700,
textTransform: 'uppercase'
}}
>
正在转变为
<li class="MuiListSubheader-root" sx="[object Object]">Manage</li>
我正在使用带有 Material-UI 5 的 create-react-app,这是我的 package.json
由于某种原因,我的 sx 道具没有转换为类名。截图
任何提示什么配置可能不正确?不确定,要提供哪些信息。
【问题讨论】:
标签: reactjs material-ui create-react-app