【发布时间】:2021-06-07 11:37:43
【问题描述】:
我需要声明这两个语句:
declare module "react" {
interface Attributes {
sx?: ThemeUIStyleObject;
}
}
和
declare module "react" {
interface Attributes {
sx?: SxStyleProp;
}
}
因为如果没有,sx 属性中会出现主题 UI 错误。
我试过了:
declare module "react" {
interface Attributes {
sx?: ThemeUIStyleObject | SxStyleProp;
}
}
但仅适用于第一个对象(ThemeUIStyleObject)
【问题讨论】:
标签: reactjs typescript next.js typescript-typings theme-ui