<title>W3xue教程 React 实例</title>
<script src="/js/react0.14.7/react.min.js"></script>
<script src="/js/react0.14.7/react-dom.min.js"></script>
<script src="/js/react0.14.7/browser.min.js"></script>
<script type="text/babel">
var Content = React.createClass({
<button onClick = {this.props.updateStateProp}>点我</button>
<h4>{this.props.myDataProp}</h4>
var HelloMessage = React.createClass({
getInitialState: function() {
return {value: 'Hello W3xue!'};
handleChange: function(event) {
this.setState({value: 'W3xue教程'})
var value = this.state.value;
<Content myDataProp = {value}
updateStateProp = {this.handleChange}></Content>
document.getElementById('example')