我是打字稿的新手,目前正在尝试将 jsx 代码转移到 tsx。尝试在 MUI 组件的帮助下制作 5 个主题。做不到

问题描述 投票:0回答:0
Type '{ styleOverrides: { root: { backgroundColor: string; }; }; }' is not assignable to type '{ defaultProps?: Partial<StackProps<"div", {}>> | undefined; variants?: { props: Partial<StackProps<"div", {}>>; style: Interpolation<{ theme: Theme; }>; }[] | undefined; }'.
  Object literal may only specify known properties, and 'styleOverrides' does not exist in type '{ defaultProps?: Partial<StackProps<"div", {}>> | undefined; variants?: { props: Partial<StackProps<"div", {}>>; style: Interpolation<{ theme: Theme; }>; }[] | undefined; }'.ts(2322)

我关注了很多答案和 youtube 视频,但还没有得到任何答案。

reactjs typescript material-ui tsx theming
© www.soinside.com 2019 - 2024. All rights reserved.