Update standalone usage

This commit is contained in:
hqproto 2021-01-11 11:42:28 -08:00 committed by Stephan Hoyer
parent d3be03c6a1
commit a671da246d

View file

@ -72,3 +72,5 @@ Another difference is that `m.render` method expects a [vnode](vnodes.md) (or a
The `m.render` module is similar in scope to view libraries like Knockout, React and Vue. It implements a virtual DOM diffing engine with a modern search space reduction algorithm and DOM recycling, which translate to top-of-class performance, both in terms of initial page load and re-rendering. It has no dependencies on other parts of Mithril aside from normalization exposed via `require("mithril/render/vnode")` and can be used as a standalone library.
Despite being relatively small, the render module is fully functional and self-sufficient. It supports everything you might expect: SVG, custom elements, and all valid attributes and events - without any weird case-sensitive edge cases or exceptions. Of course, it also fully supports [components](components.md) and [lifecycle methods](lifecycle-methods.md).
When using `m.render` as a standalone module, it may be useful to also import the [`hyperscript function`](hyperscript.md) to create the vnodes to be rendered.