The library for web and native user interfaces.
upgrade example to 0.4
manually tested
Cheng Lou committed
Jul 20, 2013 at 16:05 UTC
73ceb5a401b9c1ab3066a5360d28f671d89684da
1 file changed
+3
-3
examples/ballmer-peak/example.js
+3
-3
@@ -14,8 +14,8 @@ var BallmerPeakCalculator = React.createClass({
14
getInitialState: function() {
15
return {bac: 0};
16
},
17
- handleChange: function() {
18
- this.setState({bac: this.refs.bac.getDOMNode().value});
17
+ handleChange: function(event) {
18
+ this.setState({bac: event.target.value});
19
},
20
render: function() {
21
var bac;
@@ -33,7 +33,7 @@ var BallmerPeakCalculator = React.createClass({
33
<h4>Compute your Ballmer Peak:</h4>
34
<p>
35
If your BAC is{' '}
36
- <input ref="bac" type="text" onInput={this.handleChange} value={this.state.bac} />
36
+ <input type="text" onChange={this.handleChange} value={this.state.bac} />
37
{', '}then <b>{pct}</b> of your lines of code will have bugs.
38
</p>
39
</div>