-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo1.html
34 lines (33 loc) · 834 Bytes
/
demo1.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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>React Array!</title>
<script src="../build/react.js"></script>
<script src="../build/react-dom.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.23/browser.min.js"></script>
</head>
<body>
<div id="example"></div>
<div id="example2"></div>
<script type="text/babel">
var names = ['Tom', 'Jack', 'Ivy']
ReactDOM.render(
<div>
{
names.map(function(name){
return <div>How are you, {name}!</div>
}
)
}
</div>,
document.getElementById('example')
);
var names2 = [<h1>Good</h1>, <h2>Good</h2>, <h3>Good</h3>]
ReactDOM.render(
<div>{names2}</div>,
document.getElementById('example2')
);
</script>
</body>
</html>