mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Fix animation example code
key should never be index into an array or there are bugs. Especially in transitions. Fixes #853
This commit is contained in:
@@ -35,7 +35,7 @@ var TodoList = React.createClass({
|
|||||||
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={item} onClick={this.handleRemove.bind(this, i)}>
|
||||||
{item}
|
{item}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user