Fix animation example code
key should never be index into an array or there are bugs. Especially in transitions. Fixes #853
Paul O’Shannessy committed
Jan 29, 2014 at 13:06 UTC
d8e9eb978b3b2bbee7bfaf94dccb25fc8a3fd8ec
1 file changed
+1
-1
docs/docs/09.1-animation.md
+1
-1
@@ -35,7 +35,7 @@ var TodoList = React.createClass({
35
render: function() {
36
var items = this.state.items.map(function(item, i) {
37
return (
38
- <div key={i} onClick={this.handleRemove.bind(this, i)}>
38
+ <div key={item} onClick={this.handleRemove.bind(this, i)}>
39
{item}
40
</div>
41
);