Skip to content

[✨] Expose a function to render a JSXNode into an element in memory #257

@DustinJSilk

Description

@DustinJSilk

Is your feature request related to a problem?

To attach an element to external libraries like mapbox, we need to create html elements in memory.
Currently, we have to create the element using native JavaScript functions.

To improve DX, it would be great to be able to import a Qwik component and to render it into an HTML element.
This means the element can be used standalone in Playwright, Vitest, Storybook and in an app, as well as dynamically rendered into external libraries.

Describe the solution you'd like

A function with a potential signature createElement(node: JSX.Element). We can then do this:

const element = createElement(<MyMapMarker someProp={1234} />)
// add to library

Describe alternatives you've considered

Manually creating elements in JavaScript, which sucks

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions