d="via-the-this-keyword"><a href="#via-the-this-keyword">Via the this keyword</a></h4>
<p>State can also be accessed via the <code>this</code> keyword, which is available to all lifecycle methods as well as the <code>view</code> method of a component.</p>
<pre><code class="lang-javascript">var ComponentUsingThis = {
    oninit: function(vnode) {
        this.data = vnode.attrs.text
    },
    view: function(vnode) {
        return m(&quot;div&quot;, this.data)
    }
}

m(ComponentUsingThis, {text: &quot;Hel