【发布时间】:2019-05-24 05:12:38
【问题描述】:
当我将道具传递给孩子时,我有一个错误“属性‘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>
);
}
};
【问题讨论】:
-
您的问题似乎不完整,请您详细说明您的问题是什么?
-
什么是 DropDownItem?在上面的代码中,
DropDown被输入了isClicked属性。不是DropDownItem。
标签: reactjs typescript tsx