Svelte · Junior · Question 29 of 76
How does a component render content passed between its tags in Svelte 5?
<!-- Card.svelte -->
<script>
let { children } = $props();
</script>
<div class="card">{@render children?.()}</div>- ✓Correct answer: The content arrives as the
childrensnippet prop and is rendered with{@render children()} - 2With
<slot />only - 3With
props.childreninserted via{children}
Explanation
<slot> is the Svelte 4 mechanism. The optional call children?.() avoids an error when nothing was passed.