React Generic
![[React기반 Gatsby로 블로그 개발하기] Typescript 적용하기](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdna%2Fbrwx7E%2FbtrHd14OSfs%2FAAAAAAAAAAAAAAAAAAAAAOfqaG-GzC53_oiEehopM86P6se96nK-LgefGGVHksgl%2Fimg.png%3Fcredential%3DyqXZFxpELC7KVnFOS48ylbz2pIh7yKj8%26expires%3D1753973999%26allow_ip%3D%26allow_referer%3D%26signature%3DqvO2fAIRhYZo7nvXelJ5YyWwG%252F4%253D)
[React기반 Gatsby로 블로그 개발하기] Typescript 적용하기
Typescript 타입스크립트 : 자바스크립트의 동적 타입으로 인해 야기될 수 있는 문제를 해결할 수 있음 const str: string = "This is String" // Good const num: number = "This is String" // error TS2322: Type 'string' is not assignable to type 'number'. React 컴포넌트 작성할 때 타입 표시해줄 수 있는 것은 컴포넌트를 저장한 변수 뿐 리액트에서는 기본적으로 함수형 컴포넌트를 위한 타입 제공해줌 import React, { FunctionComponent } from 'react' import Text from 'components/Text' const IndexPage: Funct..