You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
...that is, passing children as a prop rather than a snippet. This works fine (and seems a tiny bit nicer than doing {@render children(). But SvelteKit complains from the +layout.svelte:
<slot /> or {@render ...} tag missing — inner content will not be rendered
I'm fine with ignoring the warning or doing {@render children(). But one can, as of now, pass Snippets as props in Svelte 5. So, either:
the SvelteKit+layout.svelte warning should be adjusted to account for the case, or
Svelte should prevent Snippets from being passed as props.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I'm using Svelte 5. I have a shared layout component that's meant to be used by proper
+layout.sveltecomponents. The props look like this:I've been using it like this...
...that is, passing
childrenas a prop rather than a snippet. This works fine (and seems a tiny bit nicer than doing{@render children(). But SvelteKit complains from the+layout.svelte:I'm fine with ignoring the warning or doing
{@render children(). But one can, as of now, passSnippetsas props in Svelte 5. So, either:+layout.sveltewarning should be adjusted to account for the case, orSvelteshould preventSnippets from being passed as props.Beta Was this translation helpful? Give feedback.
All reactions