React程序结构介绍-Hello world

1,程序结构 JS(JSX)+HTML+CSS

2 首先在Sublime中创建一个html文件

   输入html:5  按Tab键自动生成基础代码

   默认语言是英文语言,修改lang="zh-cn"即为中文

   具体见一下代码:

 

<!DOCTYPE html>
<html lang="en">
<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>Hello, World</p>
}
});
React.render(<HelloWorld></HelloWorld>, document.body);
</script>
</body>
</html>

posted on 2016-06-25 17:49  lihfei89  阅读(165)  评论(0编辑  收藏  举报

导航