Skip to content

Support solid-element (or JSX in general) #301

@Atulin

Description

@Atulin

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions