ReactTransitionGroup example: fix typo and logic bug in handleRemove
Brian Rue committed
Oct 25, 2013 at 18:03 UTC
c5cc145538e9becc4fc442629d5957f9cc0d451b
1 file changed
+2
-2
docs/docs/09-addons.md
+2
-2
@@ -33,14 +33,14 @@ var TodoList = React.createClass({
33
},
34
handleRemove: function(i) {
35
var newItems = this.state.items;
36
- newItems.splice(i, 0)
36
+ newItems.splice(i, 1)
37
this.setState({items: newItems});
38
},
39
render: function() {
40
var items = this.state.items.map(function(item, i) {
41
return (
42
<div key={i} onClick={this.handleRemove.bind(this, i)}>
43
- {item}}
43
+ {item}
44
</div>
45
);
46
}.bind(this));