An Introduction to Mithril Components
An Introduction to Mithril Components
As with other popular frameworks, mithril allows developers to encapsulate functionality into reusable components. A mithril component is comprised of an object containing lifecycle methods and a “view” method to render HTML. vnode(s) are javascript objects that represent the virtual DOM elements.
const componentAnatomy = { oninit: vnode => { console.log("component initialized"); }, oncreate:…
View On WordPress










