Example of a component using solid-element:
import { type ComponentType, customElement } from "solid-element";
const Icon: ComponentType<{ icon: string }> = (props) => {
return (
<svg width="24" height="24" class="o-icon" part="icon">
<title>{props.icon}</title>
<use href={`/svg/spritesheet.svg#${props.icon}`} />
</svg>
);
};
customElement("x-icon", { icon: "" }, Icon);
The data about the element can be gleaned from just the customElement() call. First param is the component name, then there's the attributes. In this case, name is x-icon and one attribute is icon: string.
Solid-element uses component-register under the hood, so perhaps that is what should be analyzed, since that package supports Preact, React, and Knockout as well.
Example of a component using solid-element:
The data about the element can be gleaned from just the
customElement()call. First param is the component name, then there's the attributes. In this case, name isx-iconand one attribute isicon: string.Solid-element uses component-register under the hood, so perhaps that is what should be analyzed, since that package supports Preact, React, and Knockout as well.