3 ms·
> Also, I hope that people don't try to implement 'reactivity' in the React way for Web Components... The correct way to handle state changes in Web Components
by meiraleal 2y ago
> Also, I hope that people don't try to implement 'reactivity' in the React way for Web Components... The correct way to handle state changes in Web Components is by changing their attributes and setting up an attributeChangedCallback inside the component
You don't want to update the component on every attribute change as the component might have multiple attributes so you need to batch the changes. Then when changing you also don't want to discard the whole rendered component and render it again. With those 2 things you have React, or much better, without a vdom: LitElement + Lit-html.