jsx、event、composition
jsx、event、composition
var Hello = React.creatClass({
return:function(){
return <div>Hello {this.prop.name}</div>
}
});
React.render(
<Hello name="World" />,
document.getElementById('container')
);
<script src="https://a.alipayobjects.com/??es5-shim/4.0.5/es5-shim.js" >
<div id="container">
<script type="text/jsx">
PPT地址 learning-react
课程内容:
如何运行demo
新建空白的html,将以下内容复制进去。
<script src="https://a.alipayobjects.com/??es5-shim/4.0.5/es5-shim.js,es5-shim/4.0.5/es5-sham.js,html5shiv/3.7.2/src/html5shiv.js,react/0.13.3/react.js,react/0.13.3/JSXTransformer.js"></script>
<div id="container"></div>
<script type="text/jsx">
// Your code here
</script>