3 ms·
Web Components are HTMLEelement instances, which are ordinary JavaScript objects on which you can set properties without any "non-native mechanisms": `document
by Ruphin 7y ago
Web Components are HTMLEelement instances, which are ordinary JavaScript objects on which you can set properties without any "non-native mechanisms":
`document.querySelector('div').someProperty = {some: 'value'};`
For DOM updates you will generally use a declarative DOM rendering engine like lit-html, just like how you use React's VirtualDOM. In fact, the most popular Web Component "library" [LitElement](https://lit-element.polymer-project.org/ https://lit-element.polymer-project.org/) uses very simlar vernacular as React (like the `render()` method), and from a developer perspective feels exactly like using React, except it relies more on builtin platform features.