Svelte 5: Slot / children example

GreggHume - Aug 21 - - Dev Community

Svelte 5 has deprecated the slot tag. So now you have to use children, but its not clear how to do this.

Here is an example of how to use the slot / children in the layout component.

<script lang="ts">
  let { children } = $props();
</script>

{@render children()}
Enter fullscreen mode Exit fullscreen mode

Before doing this you will see errors like:
"Using <slot> to render parent content is deprecated. Use {@render ...} tags instead"

. . . . . . . . . . . . . . . . . . . . . . . . .
Terabox Video Player