-
Notifications
You must be signed in to change notification settings - Fork 16
Component lifecycle
void onInit()
The callback which will be invoked after a component has been created. It's a good place to create initial state for the stateful components.
VNode onRender(
Object attrs,
Array children
)
The callback which will be invoked when a component should be rendered. It's an essential part of the component lifecycle. It should return a single child node based on attrs
, children
and possible internal state of a component. This child node can be either a TagNode
or another ComponentNode
with a component that you've defined. This method is supposed to be pure, it should have no side effects. It's allowed to return null
value, in this case <noscript/>
tag will be rendered.
void onMount(
Object attrs
)
The callback which will be invoked after a component has been mounted to the DOM.
void onAttrsReceive(
Object newAttrs,
Object prevAttrs
)
void onUpdate(
Object attrs
)
The callback which will be invoked after a component has updated its DOM.
void onUnmount()
The callback which will be invoked before a component is unmounted from the DOM.