views/Layout&quot;)

m.route(document.body, &quot;/list&quot;, {
    &quot;/list&quot;: {
        render: function() {
            return m(Layout, m(UserList))
        }
    },
    &quot;/edit/:id&quot;: {
        render: function(vnode) {
            return m(Layout, m(UserForm, vnode.attrs))
        }
    },
})
</code></pre>
<p>We replaced each component with a <a href="route.html#routeresolver">RouteResolver</a> (basically, an object with a <code>render</code> method). The <code>render</code> methods ca