(项目链接 https://github.com/wxungang/ES6_REACT_1104.git)
app.jsx 文件
/**
* Created by xiaogang on 2016/5/26.
*/
"use strict";
import ReactDOM from 'react-dom';
import test from "../components/test";
console.log(test);
ReactDOM.render(
<div>
<test className="myLists" title="header">
</test>
</div>,
document.getElementById('body')
);
test.js文件
/**
* Created by xiaogang on 2016/6/8.
*/
"use strict";
import {Component, PropTypes} from 'react';
export default class Test extends Component{
constructor(props){
super(props);
this.state={};
}
render(){
return <div>test {this.props.name }</div>
}
}
搞定问题的大神:留言我微信或者支付宝(有红包哦 weixin:15800524201 )