使用流类型检查器键入提示我的javascript代码
const functionName = (name: string, newvalue:string , units: {}) :{} => {
//Obj to be returned
const returnObj = {};
//index of a event.target.
const indexofChange: number = units.findIndex(matchElement, {
name: name
});
....
....
}
Flow给了我一个错误
Cannot call units.findIndex because property findIndex is missing in object type [1].
1 回答
谢谢@Tholle
解决这个问题