«typescript2.0» 태그된 질문

2
타이프 스크립트에서 레코드 유형은 무엇입니까?
무엇을 하는가 Record<K, T>Typescript의 의미는 ? Typescript 2.1은 그 Record유형을 예로 들어 설명했습니다. // For every properties K of type T, transform it to U function mapObject<K extends string, T, U>(obj: Record<K, T>, f: (x: T) => U): Record<K, U> Typescript 2.1 참조 그리고 고급 유형의 페이지는 언급 Record과 함께 …

12
TypeScript 및 React-어린이 유형?
다음과 같이 매우 간단한 기능 구성 요소가 있습니다. import * as React from 'react'; export interface AuxProps { children: React.ReactNode } const aux = (props: AuxProps) => props.children; export default aux; 그리고 또 다른 구성 요소 : import * as React from "react"; export interface LayoutProps { children: React.ReactNode } …

1
'this'에는 유형 어노테이션이 없기 때문에 암시 적으로 'any'유형이 있습니다.
noImplicitThis에서 활성화 tsconfig.json하면 다음 코드에 대해이 오류가 발생합니다. 'this' implicitly has type 'any' because it does not have a type annotation. class Foo implements EventEmitter { on(name: string, fn: Function) { } emit(name: string) { } } const foo = new Foo(); foo.on('error', function(err: any) { console.log(err); this.emit('end'); // error: …
당사 사이트를 사용함과 동시에 당사의 쿠키 정책개인정보 보호정책을 읽고 이해하였음을 인정하는 것으로 간주합니다.
Licensed under cc by-sa 3.0 with attribution required.