3 ms·
Lifecycles has nothing to do with vdom. Even web components has lifecycle hooks https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_element
by localvoid 9y ago
Lifecycles has nothing to do with vdom. Even web components has lifecycle hooks https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements#Using_the_lifecycle_callbacks https://developer.mozilla.org/en-US/docs/Web/Web_Components/...
Have you tried to build a components library, or have you seen any component libraries that is built on top of a framework that doesn't provide lifecycle hooks for components? Something like https://ant.design/docs/react/introduce https://ant.design/docs/react/introduce or https://developer.microsoft.com/en-us/fabric#/components https://developer.microsoft.com/en-us/fabric#/components
- naasking 9y agoThe term "lifecycle" in web components has a completely different meaning compared to its use in vdom implementations. Compare the semantics of "lifecycle" events in web components against React: https://reactjs.org/docs/react-component.html https://reactjs.org/docs/react-component.html They have virtually nothing in common. Web components are essentially just new DOM events, albeit more restricted. I started this thread by mentioning Surplus, which has no lifecycles because it operates directly on the DOM, and so React's lifecycle callbacks have no use.
- localvoid 9y ago> They have virtually nothing in common. If you think so, then there is really nothing to discuss ;)