  view: function() {return &quot;hello from a module&quot;}
}
</code></pre>
<p>In the <code>index.js</code>, you would then write this code to import that module:</p>
<pre><code class="lang-javascript">// index.js
var m = require(&quot;mithril&quot;)

var MyComponent = require(&quot;./mycomponent&quot;)

m.mount(document.body, MyComponent)
</code></pre>
<p>Note that in this example, we&#39;re using <code>m.mount</code>, which wires up the component to Mithril&#39;s autoredraw system. In most applications, y