JSX.Element vs ReactNode vs ReactElement
React.element는 type과 props를 가진 객체이다.
ReactNode는 ReactElement, ReactFragment, string, number, ReactNode의 Array, null, undefined, boolean이다.
JSX.Element는 props와 type이 any인 제네릭 타입을 가진 ReactElement이다
// ReactNode는 boolean | null | undefined 가 포함.
type ReactNode = ReactChild | ReactFragment | ReactPortal | boolean | null | undefined;

Last updated
Was this helpful?