JSX 요소, 문자열, 숫자, 배열, Fragment 등 모든 종류의 ReactNode를 포함.
import { ReactNode } from 'react';
interface MyComponentProps {
children: ReactNode;
}
function MyComponent({ children }: MyComponentProps) {
return <div>{children}</div>;
}
...
<MyComponent>
<h1>Hello, world!</h1>
<p>This is a paragraph.</p>
</MyComponent>
좋은 글 감사합니다!