Typescript에서 setState의 값을 자식 컴포넌트에 props로 넘겨주고 Typing을 해주어야한다.
해당 typing을 따로 해주는 것이 아닌 부모에서 내려줄 props에 마우스를 올리면 자식컴포넌트 props에 typing 해줄 alias를 알려준다.
[TypeScript] unknown any 차이 (0) | 2022.05.10 |
---|---|
[TypeScript] The left-hand side of an arithmetic operation must be of type ‘any’ ‘number’ or an enum type (TS2363) (0) | 2022.05.03 |
[TypeScript] interface extends (0) | 2022.04.29 |
[React, TypeScript] CRA React TypeScript 절대경로 설정하기 (0) | 2022.02.01 |