<head>
<meta charset="UTF-8">
<title>React遍歷數組</title>
<script type="text/javascript" src="../js/react.js" ></script>
<script type="text/javascript" src="../js/react-dom.js" ></script>
<script type="text/javascript" src="../js/browser.min.js" ></script>
<script type="text/babel">
var students = ["張三然","李慧思","趙思然","孫力氣","錢流量"];
ReactDOM.render(
<ul>
{
students.map(function(username){
return <li>{username}</li>
})
}
</ul>,
document.getElementById("ulLi")
)
</script>
</head>
<body>
<div id="ulLi"></div>
</body>
</html>