4 ms·
No, a web component by definition must be a class that inherits from a HTMLElement base class and implement some basic rendering functions. In addition you mus
by qbasic_forever 5y ago
No, a web component by definition must be a class that inherits from a HTMLElement base class and implement some basic rendering functions. In addition you must make the browser aware of the component by calling a CustomElementRegistry.define function with your class and the desired component name. So at a minimum there's about 5-10 lines of boilerplate JS necessary to define and register a basic component.
- e111077 5y agoYou described a Custom Element a Web Component is a branding phrase for component that uses the four following specs: * Custom Elements * Shadow DOM (seems to be optional in practice) * HTML Template Elements * ES Modules (formerly HTML Imports)