在应用程序的“反应”库中修改属性打字稿类型

问题描述

我正在使用styled-system在我们的应用程序中使用react设计样式,该应用程序的类型为@ types / styled-system here

在渲染react组件时,我发现reactstyled-system都具有自己的属性color的打字稿类型实现,这在我所使用的应用程序中引起冲突建造。我正在尝试以这种方式覆盖color类型中的react属性

declare module "react" {
  interface CustomHTMLAttributes extends Omit<HTMLAttributes<T>,'color'>{}
  interface HTMLAttributes extends CustomHTMLAttributes {
    color?: 'red' | 'blue' | 'green';
  }
}

以上实现不正确。但是为了给我一个我想要达到的目标的想法,我附上了代码示例。
如何在应用程序color库内的HTMLAttribute接口中覆盖react属性

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)