React环境搭建
2015-10-19 00:00
423 查看
安装node;
npm install --save react react-dom, 取react.min.js、react-dom.min.js;
npm install babel,取browser.min.js;
Hello World程序
页面出现Hello, world! I am a CommentBox.则为搭建成功!
npm install --save react react-dom, 取react.min.js、react-dom.min.js;
npm install babel,取browser.min.js;
Hello World程序
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Basic Example</title> <link rel="stylesheet" href="base.css" /> <script src="react.min.js"></script> <script src="react-dom.min.js"></script> <script src="browser.js"></script> </head> <body> <div id="content"></div> <script type="text/babel"> var CommentBox = React.createClass({ render: function() { return ( <div className="commentBox"> Hello, world! I am a CommentBox. </div> ); } }); ReactDOM.render( <CommentBox />, document.getElementById('content') ); </script> </body> </html>
页面出现Hello, world! I am a CommentBox.则为搭建成功!
相关文章推荐
- react native andrroid 学习相关的资料
- React Native 文件模板配置
- ReactiveCocoa基础篇
- Spring reactor框架简介
- ReactiveCocoa 谈谈RACMulticastConnection
- Java Non-Blocking and Asynchronous IO with NIO & NIO.2 (JSR203) - Reactor/Proactor Implementations
- react-native初探
- react-natvie学习
- ReactJs 样式类的使用
- ReactiveCocoa 谈谈concat
- React-Native学习指南
- 浅析最近很火的react-native技术
- [转] iOS --- ReactiveCocoa - iOS开发的新框架
- React Native For Android初体验
- ReactiveCocoa Tutorial – The Definitive Introduction: Part 2/2
- React 双向绑定的实现
- ReactiveCocoa Tutorial – The Definitive Introduction: Part 1/2
- 一次MVVM+ReactiveCocoa实践
- iOS开发新框架 - ReactiveCocoa学习
- ReactJs 组件间通信