【发布时间】:2021-05-06 23:29:39
【问题描述】:
class About extends React.Component<{},{}>{
Format = () => {
return(
<div>
{this.props.children}
</div>
)
}
Type1 = () => {
return(
<this.Format>
<div>...</div>
</this.Format>
)
}
}
我正在尝试将 <div>...</div> 传递给 Format 组件,但我收到错误:Type '{ children: Element[]; }' has no properties in common with type 'IntrinsicAttributes',我找不到关于此案例的太多信息。
【问题讨论】:
标签: reactjs components react-props