-
-
Couldn't load subscription status.
- Fork 4.7k
Closed
Description
Describe the bug
A method that was working previously to ensure a snippet prop function will always be defined was by setting the snippet prop with a default snippet defined inside the current component.
i.e.
<script>
let {children = fallback} = $props();
</script>
{#snippet fallback()}
Fallback
{/snippet}
<button>
{@render children()}
</button>This seems to have stopped working though, potentially with the changes in #9759
Can still conditionally check the children prop is defined as a workaround for setting a fallback, but I do personally prefer being able to default it, given fallback and children should exist in the same scope anyway.
Reproduction
Logs
Error: `Cannot access 'fallback' before initialization`System Info
Svelte REPLSeverity
annoyance
Metadata
Metadata
Assignees
Labels
No labels