-
- Notifications
You must be signed in to change notification settings - Fork 4.7k
Labels
Description
Demo: https://v3.svelte.technology/repl?version=3.0.0-beta.3&gist=853e7d404576d323ca476f7db99ee3d0
It’s reasonable to want to pass a slot through to a child component; the natural way to do this without adding a new DOM node is like this:
<slot name="foo" slot="foo"></slot>Unfortunately, this doesn’t work, and silently does doesn’t render the slot.
The current workaround is the same as for using components as a slot: create a regular DOM element and use that as the slot:
<div slot="foo"> <slot name="foo"></slot> </div>Vaguely related to #1037/#1713 which are about slot not yet working on components (it currently explicitly fails at compile time with a helpful message, which is a much happier failure mode).
zlsa, dimfeld, shuizhongyueming, englishmatt, dkzlv and 1 more