mirror of
https://github.com/zebrajr/react.git
synced 2026-01-15 12:15:22 +00:00
upgrade example to 0.4
manually tested
This commit is contained in:
@@ -14,8 +14,8 @@ var BallmerPeakCalculator = React.createClass({
|
||||
getInitialState: function() {
|
||||
return {bac: 0};
|
||||
},
|
||||
handleChange: function() {
|
||||
this.setState({bac: this.refs.bac.getDOMNode().value});
|
||||
handleChange: function(event) {
|
||||
this.setState({bac: event.target.value});
|
||||
},
|
||||
render: function() {
|
||||
var bac;
|
||||
@@ -33,7 +33,7 @@ var BallmerPeakCalculator = React.createClass({
|
||||
<h4>Compute your Ballmer Peak:</h4>
|
||||
<p>
|
||||
If your BAC is{' '}
|
||||
<input ref="bac" type="text" onInput={this.handleChange} value={this.state.bac} />
|
||||
<input type="text" onChange={this.handleChange} value={this.state.bac} />
|
||||
{', '}then <b>{pct}</b> of your lines of code will have bugs.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user