n object with a <code>view</code> function. Here&#39;s the code above as a component:</p>
<pre><code class="lang-javascript">var Hello = {
    view: function() {
        return m(&quot;main&quot;, [
            m(&quot;h1&quot;, {class: &quot;title&quot;}, &quot;My first app&quot;),
            m(&quot;button&quot;, &quot;A button&quot;),
        ])
    }
}
</code></pre>
<p>To activate the component, we use <code>m.mount</code>.</p>
<pre><code class="lang-javascript">m.mount(root, Hello)
</code></pre>
<p>As