React
[React교과서 ch02] hello-world-nested
일등하이
2019. 8. 6. 14:47
반응형
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div id="content"></div>
<script type="text/javascript">
//<h1>엘리먼트 두개를 자식으로 가진 <div> 엘리먼트 생성
let h1 = React.createElement('h1', null, 'Hello World!');
//세번째 또는 그 이후 매개변수가 문자열이 아니라면, 새로 생성하는 엘리먼트의 자식 엘리먼트
React.createElement('div', null, h1, h1),
document.getElementById('content')
);
</script>
</body>
</html>
|
반응형