【发布时间】:2022-01-22 06:48:27
【问题描述】:
我在键入我的 className 道具方面需要帮助。我已经尝试过使用 HTMLAttributes
className: React.HTMLAttributes<HTMLButtonElement>;
当我尝试在 className 属性中使用我的道具时出现此错误,例如“button className={className}”
"Type 'HTMLAttributes<HTMLButtonElement>' is not assignable to type 'string'."
当我在 className 道具中使用顺风类时会出现此错误
Type 'string' has no properties in common with type 'HTMLAttributes<HTMLButtonElement>'.
【问题讨论】:
-
你能检查一下这个thread的解决方案吗?
标签: reactjs typescript tailwind-css