티스토리 뷰
Element는 React Application의 가장 작은 단위이다.
//Element의 형태
const element = <div>Element</div>
React의 Element는 일반 객체(plain object)를 쉽게 생성할 수 있다.
React DOM은 React Element와 일치하도록 DOM을 업데이트 한다.
HTML 파일 어딘가 <div>가 있다고 가정해 봤을 때, 이것을 root DOM node라고 한다.
<div id="root"></div>
React로 구현된 Application은 일반적으로 하나의 root DOM node가 있고, react를 기존 Application에 통합하려는 경우 원하는 만큼 많은 수의 독립된 root DOM node를 가질 수 있다.
React 엘리먼트를 root DOM node에 렌더링 하려면 둘다 ReactDOM.render()로 전달할 수 있다.
ReactDOM.render(
const element = <h1>Hello, world</h1>,
document.getElementById('root')
);
참고 : ko.reactjs.org/docs/rendering-elements.html
엘리먼트 렌더링 – React
A JavaScript library for building user interfaces
ko.reactjs.org
'front-end > react' 카테고리의 다른 글
[React공식문서읽기] 이벤트 처리, 조건부 렌더링 (0) | 2021.04.06 |
---|---|
[React공식문서읽기] State 와 Lifecycle (0) | 2021.04.04 |
[React공식문서읽기] Components, Props (0) | 2021.04.03 |
[React공식 문서 읽기] JSX 문법 (0) | 2021.04.02 |
[React]Function Component, Class Component (0) | 2021.03.10 |