Replies: 1 comment 2 replies
-
You should be able to pass the component directly. - {#snippet hourGlass()}
- <HourGlass />
- {/snippet}
- {#snippet badge(icon, text)}
+ {#snippet badge(Icon, text)}
<span
class="inline-flex items-center gap-x-1 ..."
>
- {@render icon()}
+ <Icon />
{text}
</span>
{/snippet}
- {@render badge(hourGlass, 'Waiting')}
+ {@render badge(HourGlass, 'Waiting')} |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently, I'm rendering children through snippets with the following code:
This approach feels overly complex, because I have to keep creating new snippets for each icon I want to use. I know using a component would simplify things, but sometimes I don’t want to create a new file.
Is there an easier way to handle this?
Beta Was this translation helpful? Give feedback.
All reactions