What is “not assignable to parameter of type never” error in typescript?

前端 未结 10 2206
無奈伤痛
無奈伤痛 2020-12-04 15:08

Code is:

const foo = (foo: string) => {
  const result = []
  result.push(foo)
}

I get the following TS error:

[t

10条回答
提交回复
热议问题