-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Storybook: Update TypeScript types #53748
Conversation
👍 I'll take this into account on next contributions |
return <Button { ...props }></Button>; | ||
}; | ||
|
||
export const Default: Story< typeof Button > = Template.bind( {} ); | ||
export const Default = Template.bind( {} ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious why some stories have the type removed (Story< typeof Button >
in this case) whereas in others, it is changed from Story
to StoryFn
, like in ColorIndicator
:
export const Default: StoryFn< typeof ColorIndicator > = Template.bind( {} ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question. These explicit typings weren't necessary to begin with, because Template
is already typed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! ✅ 🚀
Follow-up to #53520
What?
Updates the deprecated
ComponentMeta
andComponentStory
types toMeta
andStoryFn
.Why?
This resolves all the TypeScript warnings for the deprecated types.
Moving forward, new stories should be written in the CSF3 format using the
StoryObj
type, but for now the existing CSF2 stories will be kept as is.Testing Instructions
✅ CI checks pass
cc @bangank36