npx create-react-app으로 설치했으면??
npm install typescript @types/node @types/react @types/react-dom @types/jest @types/react-router-dom
세트로 설치를 해줘야 한다.
export interface IWord {
id: number;
day: number;
eng: string;
kor: string;
isDone: boolean;
}
이런식으로 타입이 필요한 곳에 interface로 만들어 줄 수 있다.
타입을 일반화 하는 것을 뜻하며 선언 시점이 아니라 생성 시점에 타입을 명시하여 하나의 타입만이 아닌 다양한 타입을 사용할 수 있도록 하는 기법
https://www.typescriptlang.org/ko/docs/handbook/2/generics.html
form 이벤트 처리 예시
onclick 이벤트 처리 예시
자세한건 따로 포스팅,,,