【发布时间】:2021-06-25 06:48:47
【问题描述】:
考虑类型:
type GenericFunction = <T>(props: Array<T>) => void
和箭头函数:
const test: GenericFunction = <X>(props: X) => {
let dd: X }
test 函数为什么接受 X 作为参数,尽管类型 GenericFunction 定义了 Array<T>
作为参数?
【问题讨论】:
标签: typescript generics arrow-functions