Skip to content

Commit 37013cf

Browse files
committed
fix typing issue in Example.stories.svelte
1 parent 6f975f6 commit 37013cf

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

tests/stories/Example.stories.svelte

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@
4040
setTemplate(render);
4141
</script>
4242

43-
{#snippet render(args: Args<typeof Story>, context: StoryContext<typeof Story>)}
43+
<!--
44+
FIXME: Temporary workaround.
45+
Need to find a way on how to convert children type from `Snippet | Primitive` to `Snippet | undefined`
46+
-->
47+
{#snippet render({ children: _, ...args }: Args<typeof Story>, context: StoryContext<typeof Story>)}
4448
<Example {...args} onclick={handleClick}>
4549
<p>{args.id}</p>
4650
<p>{context.name}</p>

tests/stories/Example.svelte

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
<script lang="ts">
2-
import type { Snippet } from 'svelte';
3-
import type { HTMLAttributes } from 'svelte/elements';
2+
import type { HTMLButtonAttributes } from 'svelte/elements';
43
5-
interface Props extends HTMLAttributes<HTMLButtonElement> {
6-
children?: Snippet;
4+
interface Props extends HTMLButtonAttributes {
75
rounded?: boolean;
86
}
97

0 commit comments

Comments
 (0)