TypeScript - שימוש בסוגים עם Storybook ו-Sveltekit
אני מנסה להשתמש ב-Storybook יחד עם TypeScript ו-SvelteKit, למרות שזה יצר לי כמה בעיות שאני לא מצליח למצוא להן פתרון.
import Modal from './Modal.svelte'
export default {
title: 'Modal',
component: Modal,
}
const Template = (args: any) => ({
component: Modal,
props: args,
})
export const Primary = Template.bind({})
Primary.args = {
text: 'Hello World',
}
הקוד שלמעלה נותן לי את השגיאה הבאה בשורה Primary.args={ :
Property 'args' does not exist on type '(args: any) => { component: typeof default; props: any; }'.המדריך של ספר הסיפורים לא נראה שהוא לוקח סוגים בחשבון כאשר משתמשים ב-Svelte. https://storybook.js.org/docs/svelte/get-started/whats-a-story. אז אני לא בטוח בדיוק איך להתמודד עם זה.