- From: Justin Fagnani <notifications@github.com>
- Date: Thu, 13 Apr 2023 18:42:23 -0700
- To: WICG/webcomponents <webcomponents@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Friday, 14 April 2023 01:42:28 UTC
Components generally shouldn't be creating their own light-dom children. Their children are in their parent's root node's scope, and "belong" to that scope, not the component.
But if there is a special case where a component creates it's own light-dom children, it can just create the element by tag name:
```ts
const el = this.shadowRoot.createElement('component-a');
this.append(el);
```
The only thing the absence of a constructor prevents is calling `new ComponentA()`, it doesn't prevent creating the element at all.
--
Reply to this email directly or view it on GitHub:
https://github.com/WICG/webcomponents/issues/987#issuecomment-1507811207
You are receiving this because you are subscribed to this thread.
Message ID: <WICG/webcomponents/issues/987/1507811207@github.com>
Received on Friday, 14 April 2023 01:42:28 UTC