Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(React) checkbox group and checkbox do not render #2178

Open
stellarhoof opened this issue Jan 29, 2024 · 1 comment
Open

(React) checkbox group and checkbox do not render #2178

stellarhoof opened this issue Jan 29, 2024 · 1 comment

Comments

@stellarhoof
Copy link

Expected behavior

Checkbox group and checkbox renders

Actual Behavior

I don't know what the problem is but the checkboxes just don't render.

https://codesandbox.io/p/sandbox/wc-lion-checkbox-gt6cpv

Additional context

@lion/ui/checkbox-group.js, version 0.5.2

@ryubro
Copy link
Contributor

ryubro commented Mar 30, 2024

Hi,

It seems the problem is that the custom elements are not registered by importing just the components from @lion/ui/checkbox-group.js. After registering each components it works: https://codesandbox.io/p/sandbox/wc-lion-checkbox-forked-rklwv6

Another way to do would be something like:

import "@lion/ui/define/lion-checkbox";

export const Checkbox = createComponent({
  tagName: "lion-checkbox",
  elementClass: customElements.get("lion-checkbox"),
  react: React,
});

Or make @lion/ui/define/lion-checkbox export the custom element class as well so that we can import like:

import { LionCheckbox } from "@lion/ui/define/lion-checkbox"; // by importing this module, the custom element is registered

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants