-
Notifications
You must be signed in to change notification settings - Fork 53
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
Provide light dom props children #79
base: master
Are you sure you want to change the base?
Conversation
I've played around with this a bunch and this works great 👍 But I have encountered one issue: when I don't explicitly pass TestcaseComponents: const ParentComponent: Preact.FunctionalComponent = (props) => {
return (
<div>
<h1>Headline</h1>
{ props.children }
</div>
);
}
const ChildComponent: Preact.FunctionalComponent = (props) => {
return (
<div>Child</div>
);
} Markup: <x-parent>
<x-child></x-child>
<x-child></x-child>
</x-parent> ✅ With explicit
|
Would love to get this merged! Just ran into this issue. For now, I've added a global style:
Would be great to just have:
Edit: I've just vendored this change into my codebase. Works great! |
Any news about that? |
It's funny, in practice I've found I never actually use this. I always need at least two slots in my CEs, never just one child. I've gone back to the official build for now. |
I was wondering if porting such a popular library like Ant Design would be possible using web-components... Here's an example usage: https://codepen.io/djalmajr/pen/OJdoxqQ But this "little problem" makes it unfeasible. |
Bumped into the same problem with duplicated children components. Any intention to finalize and merge this one? |
This commit provides a resolution for issue #41, applying a strategy similar to the one used in pull request #56. The commit ensures that the children of a component, such as 'FooComponent', are correctly rendered even without using the Shadow DOM.
An example component which should render now correct in the not shadow-dom: