component
: function that declares the webcomponent for Atomico.
VanillaElement
: class that will be extended by Atomico to create Component, Atomico will not break the life cycle of the component, allowing them to interact freely.
classes produced by the Atomico function c
, these can be extended between components, example:
Consider the following effects when using this inheritance model:
The render
will be rewritten.
The props
are inherited, Atomico will reuse the previously declared props.
Styles
are inherited. Atomico will merge the stylesheets.
The c
function creates an optimized standard custom element, which can be extended to modify its behavior, be:
Adding methods.
Creating or replacing style sheets.
Creando nuevas propiedades.
Suppose we have a MyButton
product of the function c
, we can extend this component to modify its appearance without the need to completely rewrite it, example:
The benefit of this inheritance is to simplify the modification of the appearance of a component created with Atomico, since it avoids its rewriting.