docs: fix key anti-pattern snippet (#1577)

This commit is contained in:
Barney Carroll 2017-01-31 18:06:21 +00:00 committed by Pat Cavit
parent 37b38f5822
commit c12b3e8fc2

View file

@ -106,9 +106,11 @@ var Button = {
return m("button", {key: vnode.attrs.id}, u.name)
}
}
// PREFER
users.map(function(u) {
return m("div", [
m(Button, {id: u.id}, u.name) // key should be here, not in component
m(Button, {key: u.id}, u.name) // key should be here, not in component
])
})
```