用打字稿

时间:2020-06-02 09:25:47

标签: reactjs typescript material-ui

我想扩展一个组件,并添加一些额外的道具来设置其样式。 这个想法是这样的:

import { Typography, withStyles } from "@material-ui/core"

interface Props {
  extraProp: 'xl' | 'xxl'
}

const Header = withStyles((theme) => ({
  root: (props) => {
    ...
  }
}))(Typography)

export default Header

我在键入多余的道具时遇到问题。...想法?

0 个答案:

没有答案