Replies: 1 comment 2 replies
-
In Lit you would just use a template instead of a component. The rest of the questions are not Lit-specific, but web components related. In general you shouldn't be replacing your self with content because the host element belongs to the outer element and you shouldn't modify the outer element's DOM. That's mostly a concern with reusable / maximally interoperable components and might not apply to app-specific components. Why do you want to replace a component with it's content? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
If an element
<my-header>
looks like this:I want to replace the definition:
With its contents:
In the React world, there are React fragments. This lets you return multiple nodes without a parent.
Does lit have something like it?
The closest I can find in lit is to use the connectedCallback like this:
How will such a solution affect
<slot>
?Beta Was this translation helpful? Give feedback.
All reactions