저는 TypeScript 2.5.2를 사용하고 있습니다. 다른 프로젝트에서 동일한 코드가 작동하는 TypeScript 2.2.2로 다운 그레이드를 시도했습니다.TypeScript 오류는 만족하지 않습니다
이 ** 오류 : 파일 : Weather.tsx ' 심각도'오류 '메시지 : '유형의 인자 '(대응 : IListItem) => 공극이'타입 의 파라미터에 할당되지 않은 경우 (값 : {weather : IListItem;}) => void | PromiseLike '. 'response'및 'value'매개 변수 유형이 호환되지 않습니다.
유형 '{날씨 : IListItem; } '은'IListItem '유형과 공통된 속성이 없습니다. **
구문에 어떤 문제가 있습니까? .then((response: HttpClientResponse): Promise<{weather: IListItem}>
의 형식 매개 변수는 응답 유형 IListItem
의 weather
속성 객체임을 지정 : GitHub
.then ((response : HttpClientResponse) : Promise) 제 해결책입니다. –
JoshYates1980
비슷한 문제가 있습니다. 오류의 원인을 알고 계십니까? : https://github.com/CodeHeight/some- webparts/issues/1 – JoshYates1980
SO 질문으로 게시하면 다른 사람들도 이동 가능합니다 :-) – Oblosys