【发布时间】:2022-01-02 17:13:44
【问题描述】:
const Label = (props) => {
return <label className={"card-label"} {...props.attributes}>{props.children}</label>;
};
如果我尝试访问其他函数中的属性。我遇到错误,无法继续
<Label attributes={style:{margin:"10px"}}>Select Tip %</Label>
有人知道答案吗?如何使用 props 传递任何组件的所有其他属性?
【问题讨论】:
-
通常,当您看到错误时,值得在问题中包含错误消息。
-
@DBS - 我忘了添加错误信息。下次我一定会添加错误信息。