请看这个例子:
const MyFunction: SomeType<SomeProp> = () => {
}
在命名箭头函数中输入 MyFunction
更容易,但如何在基于 function 关键字的函数中做同样的事情?
function MyFunction() {} // ???
最佳答案
检查一下:
const MyFunction: SomeType<SomeProp> = function() {
}
关于javascript - 在 TypeScript 中,我可以轻松地键入命名箭头函数,但是如何在基于函数关键字的函数中做同样的事情呢?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56214397/