【发布时间】:2020-02-07 05:19:22
【问题描述】:
我有 Typescript 和 React 环境的标准箭头映射 ES7 函数:
const getItemList: Function = (groups: any[]): JSX.Element =>
group.map((item: any, i: number) => {
const itemCardElemProps = { handleEvents: () => {}, ...item}
return <Item key={`${item.id}_${i}`} {...itemCardElemProps} />
})
并得到错误:
TS2739: Type 'Element[]' is missing the following properties from type 'Element': type, props, key
版本:打字稿 3.5.3
【问题讨论】:
标签: reactjs typescript