forked from enshahar/learning-react-kor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path04-components.html
42 lines (34 loc) · 984 Bytes
/
04-components.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>리액트 콤포넌트</title>
</head>
<body>
<!-- Target Container -->
<div id="react-container"></div>
<!-- React Library & React DOM-->
<script src="https://unpkg.com/react@16/umd/react.development.js"></script>
<script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
<script>
const IngredientsList = ({items}) =>
React.createElement("ul", {className: "ingredients"},
items.map((ingredient, i) =>
React.createElement("li", { key: i }, ingredient)
)
)
const items = [
"연어 500그램",
"잣 1 컵",
"버터 상추 2 컵",
"옐로 스쿼시(Yellow Squash, 호박의 한 종류) 1개",
"올리브 오일 1/2 컵",
"마늘 3 쪽"
]
ReactDOM.render(
React.createElement(IngredientsList, {items}, null),
document.getElementById('react-container')
)
</script>
</body>
</html>