With Valyrian.js, components don't have lifecycle, just Virtual dom nodes have them. You can apply the next lyfecycle methods to the Virtual dom:- oncreate
- onbeforeupdate
- onupdate
- onremove
let Component = (props, world) => <div {...props}>Hello {world}div>;
let lifecycle = {
oncreate(newVnode) {
console.log(vnode);
},
onbeforeupdate(newVnode, oldVnode) {
console.log(newVnode, oldVnode);
},
onupdate(newVnode, oldVnode) {
console.log(newVnode, oldVnode);
},
onremove(oldVnode) {
console.log(oldVnode)
}
};
v(Component, lifecycle, 'World');
<Component {...lifecycle}> World Component>