Skip to content

Commit dd66223

Browse files
zpaovjeux
authored andcommitted
Fix animation example code
key should never be index into an array or there are bugs. Especially in transitions. Fixes facebook#853
1 parent 6e4ddfd commit dd66223

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/docs/09.1-animation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ var TodoList = React.createClass({
3535
render: function() {
3636
var items = this.state.items.map(function(item, i) {
3737
return (
38-
<div key={i} onClick={this.handleRemove.bind(this, i)}>
38+
<div key={item} onClick={this.handleRemove.bind(this, i)}>
3939
{item}
4040
</div>
4141
);

0 commit comments

Comments
 (0)