Skip to content

Allow Svelte components to be slot roots #1713

Closed
@andyjessop

Description

@andyjessop

https://svelte.technology/repl?version=2.13.2&gist=1a69018031dc8c34d013de01a70579a1

Instead of this:

<Layout>
  <Component slot="my-slot" />
</Layout>

I have to do this:

<Layout>
  <div slot="my-slot">
    <Component />
  </div>
</Layout>

This adds an unnecessary DOM layer and possibly means adjusting CSS.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions