当我将道具传递给孩子时,我有一个错误“属性'isClicked'不存在于类型'IntrinsicAttributes & IntrinsicClassAttributes”我写了“isClicked?:布尔”。我还应该做什么?
export interface DropDownProperties extends ComponentBaseProperties {
multiSelect?: boolean;
IconTextColor?:string;
isClicked?: boolean;
}
export interface DropDownState extends ComponentBaseState {
dropDownOptions: DropDownItem[];
isOpen: boolean;
results: string[];
isClicked?: boolean;
}
export default class DropDown extends ComponentBase<
DropDownProperties,
DropDownState
> { return ( <DropDownItem
iconName={option.iconName}
value={option.value}
displayValue={option.displayValue ? true : false}
key={option.name}
onClick={(e) => this.optionSelected()}
isClicked={this.state.isOpen}
>
{option.props.children}
</DropDownItem>
))}
</ul>
);
}
};