marielle
marielle

Reputation: 428

Svelte named slot use always the fallback

I created this basic Svelte example following the official tutorial.

App.svelte:

<script>
    import PageWrapper from './PageWrapper.svelte'
</script>

<PageWrapper>
  <div name="cover">
    My cover
  </div>
</PageWrapper>

PageWrapper.svelte:

The cover is:
<slot name="cover">no cover</slot>

The result is always:

The cover is: no cover

Why? What am I doing wrong?

Upvotes: 0

Views: 85

Answers (1)

brunnerh
brunnerh

Reputation: 184376

This:

<div name="cover">

Should be:

<div slot="cover">

Upvotes: 1

Related Questions