
// type과 props로 이루어져있는 객체
const element = {
type: 'h1',
props: {
className: 'greeting',
children: 'Hello, world!'
}
};
// React.createElement 메서드 사용 시
const element = React.createElement(
'h1',
{ className: 'greeting' },
'Hello, world!'
);
// jsx 사용 시
const element = <h1 className="greeting">Hello, world!</h1>