Passing Data Back to Parent with Scoped Slots #17620
Unanswered
karchung0930
asked this question in
Q&A
Replies: 1 comment 3 replies
-
|
This can be done via snippets, e.g. <!-- ComponentA.svelte -->
<script>
let { rows, customRowTemplate } = $props();
</script>
{#each rows as row (row.id)}
{#if row.dataType === 'custom'}
{@render customRowTemplate(row)}
{/if}
{/each}<ComponentA {rows}>
{#snippet customRowTemplate(row)}
Custom: {row.id}
{/snippet}
</ComponentA> |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Is it possible to pass data into a component and have the component expose that data back for custom rendering?
Beta Was this translation helpful? Give feedback.
All reactions