type TProp<RowType = any> = (
props: IProp<RowType>,
ref?: React.Ref<Refs>
) => React.ReactElement | null
const My: TProp = ()=>{}
interface IProp<RowType> {
list: RowType[]
renderItem: (row: RowType, index: number) => JSX.Element
}
export default forwardRef(My) as <RowType extends any>(
props: IProp<RowType> & {
ref?: React.Ref<Refs>
}
) => JSX.Element
React 组件定义(泛型)
最新推荐文章于 2023-11-03 22:42:55 发布