-
Notifications
You must be signed in to change notification settings - Fork 623
Driver Specification
ZeroLing edited this page Mar 28, 2020
·
2 revisions
Driver is the key concept that make the application cross-container running. Rax have been implemented DOM driver, server driver and weex driver. If want Rax works on other container, only need implement the driver specification. The driver should implement follow method:
- createBody()
- createEmpty(component)
- createText(text, component)
- updateText(node, text)
- createElement(type, props, component)
- appendChild(node, parent)
- removeChild(node, parent)
- replaceChild(newChild, oldChild, parent)
- insertAfter(node, after, parent)
- insertBefore(node, before, parent)
- addEventListener(node, eventName, eventHandler)
- removeEventListener(node, eventName, eventHandler)
- setAttribute(node, propKey, propValue)
- removeAttribute(node, propKey)
- setStyle(node, styleObject)
- *beforeRender({element, hydrate, container})
- *afterRender({element, hydrate, container})