Skip to content
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

Replace @storybook/addon-knobs with addon-controls #677

Open
frankieyan opened this issue Aug 9, 2022 · 2 comments
Open

Replace @storybook/addon-knobs with addon-controls #677

frankieyan opened this issue Aug 9, 2022 · 2 comments
Assignees

Comments

@frankieyan
Copy link
Member

frankieyan commented Aug 9, 2022

As addon-knobs is deprecated (ref), it should be replaced with @storybook/addon-controls.

There are only two stories (avatar, keyboard-shortcuts) left that are using knobs.

@frankieyan frankieyan changed the title Replace @storybook/addon-knobs with addon-controls in Reactist Replace @storybook/addon-knobs with addon-controls Aug 9, 2022
@HenryKenya
Copy link

Will this involve re-writing the stories using args? Sounds interesting and I'd like to give it a shot @frankieyan

@frankieyan
Copy link
Member Author

Hi @HenryKenya - yes args and argTypes can both be used. The latter is to give more control into what kind of UI we want to show in order to change the props: https://storybook.js.org/docs/react/essentials/controls#choosing-the-control-type

The two stories are:
https://github.com/Doist/reactist/blob/v14.0.0/stories/components/Avatar.stories.tsx
https://github.com/Doist/reactist/blob/v14.0.0/stories/components/KeyboardShortcut.stories.tsx

I believe they already have argTypes set up, but Avatar still declares knobs as a decorator even though it is not needed, and KeyboardShortcut seems to have both declared.

Once both of these have knobs removed, we can then remove the @storybook/addon-knobs dependency.

Thank you for offering to do this :) Let me know how it goes 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants