반응형

에러

- 원인: @rumess/react-flip-countdown은 type을 제공하지 않기 때문
해결 방법
방법-1
tsconfig.json에 noImplicitAny 를 추가하면 해결.
"noImplicitAny": false
noImlicitAny
암묵적으로 any 타입을 가지는 것을 허락하지 않음.
- false로 설정하는 경우?
- 기존 자바스크립트 프로젝트를 타입스크립트로 마이그레이션 하는 경우. 이를 제외하면 true로 설정하는 것이 좋다.
위의 이유에 따라서 noImlicitAny는 사용하지 않는 것이 좋다고 판단.
방법-2
node_modules/@rumess/react-flip-countdown/dist에 index.d.ts 파일을 생성하고,
declare module '@rumess/react-flip-countdown'
작성하니 에러 해결됨.
반응형
'Front-End: Web > TypeScript' 카테고리의 다른 글
[TypeScript] Partial & Required / Record / Exclude & Extract (0) | 2023.07.30 |
---|---|
TypeError: relativeURL.replace is not a function (0) | 2023.07.22 |
Uncaught TypeError: Cannot add property current, object is not extensible (feat. forwardRef) (0) | 2023.07.22 |
[코딩애플] ts part 2-7. Generic 함수 (0) | 2022.10.28 |
[코딩애플] ts part 2-6. import export & namespace (0) | 2022.10.28 |