=> this代表这个函数对象不是外部的
<html>
<head>
<title>Document</title>
<script src="../react.js"></script>
<script src="../react-dom.js"></script>
<script src="http://cdn.bootcss.com/babel-core/5.8.38/browser.min.js"></script>
</head>
<body>
<div id="reactContainer"/>
<script type="text/babel">
const TexBoxComponent = React.createClass({
getInitialState: () => ({enable:false}),
handleClick: function(event) {this.setState({enable: !this.state.enable})},//单数据流
render: function() {
return <p>
<input type="text" disabled={this.state.enable}/>
<button onClick={this.handleClick}>change textbox state</button>
</p>}
})
ReactDOM.render(
<TexBoxComponent/>,
document.getElementById('reactContainer')
)
</script>
</body>
</html>