0

m() makes virtualDom?

m.render() makes realDom?

That means m.render() is always required?

aronadaal
  • 9,083
  • 1
  • 19
  • 33
re96
  • 41
  • 1
  • 6

1 Answers1

1

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).
ciscoheat
  • 3,719
  • 1
  • 35
  • 52