我正在将项目从 jsx 重写为 tsx,更改为 tsx 后,ui kit mui for classes 的复选框出现错误。
Type 'string | undefined' is not assignable to type 'Partial<CheckboxClasses> | undefined'.
Type 'string' has no properties in common with type 'Partial<CheckboxClasses>'.ts(2322)
Checkbox.d.ts(26, 3): The expected type comes from property 'classes' which is declared here on type 'IntrinsicAttributes & CheckboxProps'
为了。
1. 有一个接口,描述了数据和它们实现的类型
2. 传递给复选框时,我得到这样的错误,我不知道如何解决它:(

PS我也在Google Drive上转移了复选框本身(我提醒你它不是自己编写的,而是来自mui库
您需要
checkbox更改AccordionProps.classes. 即,您需要更改string为Partial<CheckboxClasses>