강의

멘토링

로드맵

인프런 커뮤니티 질문&답변

Hndx님의 프로필 이미지
Hndx

작성한 질문수

웹 게임을 만들며 배우는 React에 TypeScript 적용하기

로또 추첨기와 FC, useMemo

React.FC에 대해 궁금합니다.

작성

·

699

0

안녕하세요~

React.FC에 대해 조금 찾아보니 사용하지 않는 것을 추천한다는 말이 있던데,

 

상황에 맞게 사용하면 되는 것인지

아니면 사용하지 않는 추세가 맞는 것인지

또한 사용하신 이유가 있는 것인지 궁금합니다. 

퀴즈

What are the main roles of TypeScript's `typeof` and `keyof` operators explained in the lecture?

Checks the actual type of the variable at runtime.

Creates new types or gets property names from existing values or object types.

Force type conversion or remove potential undefined values.

Define the return type of an asynchronous function or set the inheritance relationship of a class.

답변 1

1

제로초(조현영)님의 프로필 이미지
제로초(조현영)
지식공유자

https://fettblog.eu/typescript-react-why-i-dont-use-react-fc/

이거 읽어보시면 될 것 같은데요. 사실 저는 FC를 안 쓸 큰 이유라고는 볼 수 없다고 생각합니다.

Children이 없으면 VFC 타입을 대신 쓰면 됩니다.

Hndx님의 프로필 이미지
Hndx

작성한 질문수

질문하기