il to intelligently re-order the DOM to maintain each DOM element correctly mapped to its respective item in the data source.</p>
<pre><code class="language-javascript">function correctUserList(users) {
    return users.map(function(u) {
        return m(&quot;button&quot;, {key: u.id}, u.name)
    })
}</code></pre>
<p>Also, you might want to reinitialize a component. You can use the common pattern of a single-child keyed fragment where you change the key to destroy and reinitialize the element.</p>
<pre><c