component, the key must be moved out of the component and put on the component itself, since it is now the immediate child of the array.</p>
<pre><code class="language-javascript">// AVOID
var User = {
    view: function(vnode) {
        return m(&quot;div&quot;, { key: vnode.attrs.user.id }, [
            m(Button, vnode.attrs.user.name)
        ])
    }
}

// PREFER
users.map(function(u) {
    return m(User, { key: u.id, user: u }) // key should be here, not in component
})</code></pre>
<h4 id="avoid-wrap