一、架构
二、注释
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="UTF-8">
<title>Hello, World</title>
</head>
<body>
<script src="./react-0.13.2/react-0.13.2/build/react.js"></script>
<script src="./react-0.13.2/react-0.13.2/build/JSXTransformer.js"></script>
<script type="text/jsx">
var HelloWorld = React.createClass({
render: function () {
return <p
/*
comment...
*/
name="test" // set name to test
>Hello, World{
/*
comment...
comment
*/ "hello, " // comment...
}</p>
}
});
React.render(<div><HelloWorld></HelloWorld></div>, document.body);
</script>
</body>
</html>
三、语法