m()
makes virtualDom
?
m.render()
makes realDom
?
That means m.render()
is always required?
m()
makes virtualDom
?
m.render()
makes realDom
?
That means m.render()
is always required?
Yes, pretty much! From the m() documentation on the Mithril site:
This is a convenience method to compose virtual elements that can be rendered via
m.render()
.
There are other ways to display stuff than m.render()
however, with the help of components. A summary from the m.component() documentation page:
There are three ways to render a component:
m.route
(if you are building a single-page application that has multiple pages)m.mount
(if your app only has one page)m.render
(if you are integrating Mithril's rendering engine into a larger framework and wish to manage redrawing yourself).