context from the parent web-component is not shared to its children | solid-element #2364
Labels
webcomponents
related to solid-element, custom elements, shadow dom, or other web component related features
Describe the bug
For Solid Hack 2024, I experimented with the
solid-element
API to convert Solid components into web components. I attempted to create a ShadCN-based web component library, aiming to make it particularly useful for the HTMX community. I saw this as a strong use case for Solid.js.I tried porting an
Accordion
component to a web component, so that end-users could use it like this:However, since each sub-component like
AccordionItem
andAccordionContent
was converted toaccordion-item
andaccordion-content
, I encountered the following errors:These errors are caused because
kobalte
expects certain contexts to be nested within specific parent components, but the web component conversion disrupts this hierarchy.Your Example Website or App
https://studio.webcomponents.dev/edit/VcOP3wIWw9SP1xt0fMwf/src/components.jsx?file=https://srv.divriots.com/packd/@kobalte/core/accordion,@kobalte/core/combobox,@kobalte/core/select,@kobalte/core/text-field,clsx,lit-html,lucide-solid,solid-element,solid-js,solid-js/web,tailwind-merge
Steps to Reproduce the Bug or Issue
write a composable ui component using
solid-element
and solidjs's context api and store api.it will throw error like this
Expected behavior
context should be shared b/w children in web components too
Screenshots or Videos
No response
Platform
Additional context
No response
The text was updated successfully, but these errors were encountered: