Skip to content

Upgrade to SB9 and global context #313

Closed Answered by JReinhold
rogerfar asked this question in Q&A
Discussion options

You must be logged in to vote

Your story syntax is a little off, you're actually passing the <Select {items} ... /> component as a child to the Select component. You're essentially using the "With children" pattern: https://github.com/storybookjs/addon-svelte-csf#with-children

But it looks like you want to render the content as is, which the asChild-prop on Story is for: https://github.com/storybookjs/addon-svelte-csf#static-template

So you'd do this instead:

<script module lang="ts">
	import Select from '$lib/components/select/Select.svelte';
	import { defineMeta } from '@storybook/addon-svelte-csf';

	const { Story } = defineMeta({
		title: 'Select',
		component: Select
	});
</script>

<script lang="ts">
	type Item =

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by JReinhold
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants