import { dom, element, string } from 'decca'
createRenderer(el, dispatch?)
Param | Type | Description |
---|---|---|
el |
DOMNode | The DOM element to mount to |
dispatch |
function, optional | The dispatch function to the store |
Returns
render
Creates a renderer function that will update the given rootEl
DOM Node if
called. Returns a renderer function; see render.
render(element, context?)
Param | Type | Description |
---|---|---|
element |
Element | Virtual element to render; given by element() |
context |
*, optional | The context to be passed onto the components as context |
Returns
void
(callback)
A renderer function returned by createRenderer().
element(tag, props, ...children?)
Param | Type | Description |
---|---|---|
tag |
string | Tag name (eg, 'div' ) |
props |
object | Properties |
children |
Element | string, optional |
Returns
Element
Returns a vnode (Element) to be consumed by render(). This is compatible with JSX. Returns An element.
{ tag, props, children }
Param | Type | Description |
---|---|---|
tag |
string | Tag name (eg, 'div' ) |
props |
object | Properties |
children |
(Element | string)[] |
A vnode (Element) to be consumed by render(). This is generated via element().
render(el, context?)
Param | Type | Description |
---|---|---|
el |
Element | The Element to render |
context |
*, optional | The context to be passed onto components |
Returns
string
Renders an element into a string without using the DOM. Returns the rendered HTML string.