vdom-to-html
Turn virtual-dom nodes into HTML
Installation
npm install --save vdom-to-html
Usage
var VNode = ;var toHTML = ; ;// => '<input class="name" type="text">'
Special case for Widgets
Widgets are used to take control of the patching process, allowing the user to create stateful components, control sub-tree rendering, and hook into element removal. Documentation is available here.
Widgets are given an opportunity to provide a vdom representation through an optional render
method. If the render
method is not found an empty string will be used instead.
var { thistext = text;}Widgetprototypetype = 'Widget';// provide a vdom representation of the widgetWidgetprototype { return 'span' null thistext;};// other widget prototype methods would be implemented ;// => '<span>hello</span>'