정의
React Elements / DOM Elements

ex)
{
type : ‘button’, // 태그이름
props : { // 속성
className : ‘bg-green’,
children: {
type : ‘b’,
props: {
children : ‘Hello, element!’
}
}
}
}
랜더링 후
ex)
<button class=‘bg-green’>
<b>
Hello, element!
</b>
</button>
엘리멘트 타입이 문자열이 아닌 경우
ex)
{
type : Button, // 리액트 컴포넌트의 이름
props : {
color : ‘green’,
children : ‘Hello, element!’
}
}
createElement가 만들어 준다
ex)
React.createElement(
type, // html태그가 문자열로 ,혹은 리액트 컴포넌트가 들어간다 -> 최종적으로 html태그로 변환된다
//하나의 컴포넌트, 여러 자식 컴포넌트, 자식 컴포넌트를 분해해 보면 html태그가 나온다
[props], //속성(class, style), attribute보다 상위개념
[…children] // 자식 엘리먼트
)
