【发布时间】:2021-01-06 04:17:04
【问题描述】:
我认为我必须编写错误在根标记中给出的以下类型:
No overload matches this call.
Overload 1 of 2, '(style: Styles<Theme, {}, "root">, options?: Pick<WithStylesOptions<Theme>, "flip" | "element" | "defaultTheme" | "name" | "media" | "meta" | "index" | "link" | "generateId" | "classNamePrefix">): (props?: any) => Record<...>', gave the following error.
Type 'string' is not assignable to type 'CSSProperties | CreateCSSProperties<{}> | PropsFunc<{}, CreateCSSProperties<{}>>'
问题是我只是不知道该怎么做,以前从来没有输入过这样的东西。您可以在此处找到代码:https://codesandbox.io/s/github/pedroRelvas/HowToTypeTheStyleRoot(您可以在文件 demo.tsx 中找到错误)。请给我解释一下好吗?
谢谢。
【问题讨论】:
标签: typescript types material-ui styles tsx