We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 90f8a89 + 3516f33 commit cb05e2fCopy full SHA for cb05e2f
docs/_js/examples/todo.js
@@ -1,8 +1,8 @@
1
var TODO_COMPONENT = `
2
var TodoList = React.createClass({
3
render: function() {
4
- var createItem = function(itemText) {
5
- return <li>{itemText}</li>;
+ var createItem = function(itemText, index) {
+ return <li key={index + itemText}>{itemText}</li>;
6
};
7
return <ul>{this.props.items.map(createItem)}</ul>;
8
}
0 commit comments