ReactChild, ReactNode, ReactElement 한 줄 요약 설명
date
Mar 25, 2022
slug
3
status
Published
tags
Dev
React
summary
JSX관련 타입 한줄 요약 해봤습니다
type
Post
속성
ReactNode
JSX내에 들어갈 수 있는 허용된 모든 요소
type ReactNode = ReactChild | ReactFragment | ReactPortal | boolean | null | undefined;
ReactChild
완성된 JSX요소 + 원시타입의 값
type ReactChild = ReactElement | ReactText;
ReactElement
완성된 JSX요소만을 허용한다
interface ReactElement<P = any, T extends string | JSXElementConstructor<any> = string | JSXElementConstructor<any>> {
type: T;
props: P;
key: Key | null;
}