• 카테고리

    질문 & 답변
  • 세부 분야

    프론트엔드

  • 해결 여부

    미해결

typescript관련

20.06.10 17:27 작성 조회수 936

1

코드를 따라서 하다가 저만 오류나는 상황입니다..ㅡ,,ㅡ

function Component(constructorfn?:Function){

    return constructorfn
}

@Component()
class AppComponent{

    constructor(){

    }
}
function Component(constructorfn?: Function | undefined): Function | undefined
Unable to resolve signature of class decorator when called as an expression.
This expression is not callable.
No constituent of type 'Function | undefined' is callable.

답변 2

·

답변을 작성해보세요.

0

Kyuyoung Jang님의 프로필

Kyuyoung Jang

2020.12.30

저도 같은 문제가 발생했었는데

아래와 같이 해결했습니다!

// tsconfig.json에서 "experimentalDecorators": true, 설정 -> 안됨
// tsconfig.json에서 restrict 주석 처리
// > tsc 4_decoration.ts --experimentalDecorators "true"

0

타입스크립트 설정이랑 관련있을 것 같은데 정확하게는 원인을 모르겠네요 좀더 자세한 정보를 주실 수 있을까요?