我的代码中有打字错误
typescript Property 'type' does not exist on type 'never'
export const getSomething = (actionLog: [] | undefined) => {
console.info(actionLog[length - 1].type)
}
问题出在哪里?
发布于 2019-03-16 04:15:29
解决方案是为' type‘属性定义类型:
export const getSomething = (actionLog: {type: string}[] | undefined) => {