= {
    view: function (vnode) {
        return m(&quot;div&quot;, &quot;Hello, &quot; + vnode.attrs.name)
    }
}
</code></pre>
<p>NOTE: Lifecycle methods can also be provided via the <code>attrs</code> object, so you should avoid using the lifecycle method names for your own callbacks as they would also be invoked by Mithril. Use lifecycle methods in <code>attrs</code> only when you specifically wish to create lifecycle hooks.</p>
<hr>
<h3 id="lifecycle-methods"><a href="#lifecycle-methods">Lifecycle meth