Browse Source

ReactTransitionGroup example: fix typo and logic bug in handleRemove

main
Brian Rue 11 years ago
parent
commit
2226476039
  1. 4
      docs/09-addons.md

4
docs/09-addons.md

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

Loading…
Cancel
Save