Argument of type 'X' is not assignable to parameter of type 'X'

前端 未结 9 1945
名媛妹妹
名媛妹妹 2021-02-02 05:15

Good day. I\'m new to Type Script, using VSCode.

Getting following errors:

  1. error TS2322: Type \'() => string\' is not assignable to type

9条回答
  •  一个人的身影
    2021-02-02 05:34

    In my case, it was that I had a custom interface called Item, but I imported accidentally because of the auto-completion, the angular Item class. Be sure that you're importing from the right package.

提交回复
热议问题