ReactTransitionGroup example: fix typo and logic bug in handleRemove

This commit is contained in:
Brian Rue
2013-10-25 18:03:31 -07:00
parent 0d2d3360d0
commit c5cc145538

View File

@@ -33,14 +33,14 @@ var TodoList = React.createClass({
},
handleRemove: function(i) {
var newItems = this.state.items;
newItems.splice(i, 0)
newItems.splice(i, 1)
this.setState({items: newItems});
},
render: function() {
var items = this.state.items.map(function(item, i) {
return (
<div key={i} onClick={this.handleRemove.bind(this, i)}>
{item}}
{item}
</div>
);
}.bind(this));