我正在尝试启动一个项目,但遇到了问题。 有人成功地将 Create-react-app + react-app-rewired + typescript + antd 结合使用吗?我尝试了所有可用的教程/自定义脚本/加载器,但没有运气。 我以为https://github.com/SZzzzz/react-scripts-ts-antd将是解决我的所有问题的答案,但出现编译错误:
(28,81): 类型 '{ className: string; style: { transition: string | boolean; msTransform: string; WebkitTransform:...' 不能满足约束条件 'HTMLAttributes<HTMLElement>'。 属性'style'的类型不兼容。 类型'{transition:string | boolean;msTransform:string;WebkitTransform:string;transform:string;}' 不能赋值给类型'CSSProperties | undefined'。 类型'{transition:string | boolean;msTransform:string;WebkitTransform:string;transform:string;}' 不能赋值给类型'CSSProperties'。 属性'transition'的类型不兼容。 类型'string | boolean' 不能赋值给类型'string | undefined'。 类型 'true' 不能赋值给类型 'string | undefined'。
(28,81): 类型 '{ className: string; style: { transition: string | boolean; msTransform: string; WebkitTransform:...' 不能满足约束条件 'HTMLAttributes<HTMLElement>'。 属性'style'的类型不兼容。 类型'{transition:string | boolean;msTransform:string;WebkitTransform:string;transform:string;}' 不能赋值给类型'CSSProperties | undefined'。 类型'{transition:string | boolean;msTransform:string;WebkitTransform:string;transform:string;}' 不能赋值给类型'CSSProperties'。 属性'transition'的类型不兼容。 类型'string | boolean' 不能赋值给类型'string | undefined'。 类型 'true' 不能赋值给类型 'string | undefined'。