Skip to content

Commit 69312af

Browse files
feat: typing storybook component
1 parent db010c3 commit 69312af

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/components/Greeting/Greeting.stories.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
import { Component as Greeting } from './Greeting'
1+
import { Meta, Story } from '@storybook/react'
2+
import { Component as Greeting, Props } from './Greeting'
23

34
export default {
45
title: 'components/Greeting',
56
component: Greeting,
67
argTypes: {
78
target: { control: 'text' },
89
},
9-
}
10+
} as Meta<Props>
1011

11-
const Template = (args) => <Greeting {...args} />
12+
const Template: Story<Props> = (args) => <Greeting {...args} />
1213

1314
export const World = Template.bind({})
1415
World.args = {

src/components/Greeting/Greeting.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react'
22

3-
type Props = {
3+
export type Props = {
44
target: string
55
}
66

0 commit comments

Comments
 (0)