函数组件的泛型
来源:9-6 【reducer管理】combineReducers

慕雪455456
2023-02-17
函数组件的泛型里面的的类型,使用“&”连接,和使用“,”连接,有什么区别
写回答
1回答
-
阿莱克斯刘
2023-02-28
<T, S> 中的逗号表示的是react component需要输入两个范型参数:第一个参数是prosptype,它是wihtranslation、ReturnType<typeof mapState>、ReturnType<typeof mapDispatch>这三个类型的集合体(用“&”链接);而第二个范型参数则是State。
建议看一下课程的附加章节,先了解一下ts范型相关的语法。
00
相似问题