Skip to content

Typescript migration 과정에서 함수 props의 type #635

Answered by woohm402
HyeongtaekOh asked this question in Q&A
Discussion options

You must be logged in to vote

함수마다 타입 적어주시는 게 맞습니다. 일반적으로는 파라미터와 리턴 타입을 적습니다. Function을 타입으로 쓰는 건 피해야 합니다.

setSelectedStudent: (student: Student) => void;

일일이 써주셔야 되는 거 맞습니다만 변수든 함수든 타입의 복잡도가 크게 차이나지 않긴 합니다!

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
2 replies
@woohm402
Comment options

@HyeongtaekOh
Comment options

HyeongtaekOh Nov 5, 2021
Collaborator Author

Comment options

You must be logged in to vote
1 reply
@HyeongtaekOh
Comment options

HyeongtaekOh Nov 5, 2021
Collaborator Author

Answer selected by woohm402
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
React React 관련 내용
2 participants