You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 5, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Jan 5, 2023. It is now read-only.
importReactfrom"react"import{storiesOf,addDecorator}from"@storybook/react"import{withKnobs}from"@storybook/addon-knobs"import{withSmartKnobs}from"storybook-addon-smart-knobs"import{withInfo}from"@storybook/addon-info"// add-onimport{action}from"@storybook/addon-actions"// componentimportButtonfrom"./"storiesOf("Button",module).addDecorator((story,context)=>withInfo("A button with a simple label")(story)(context)).addDecorator(withSmartKnobs).addDecorator(withKnobs).add("With a label",()=><Buttonlabel="Hey"onClick={action("Boo")}/>)
Sadly, it doesn't generate the component's knobs (nor its props proptype with info add-on). If I only use withKnobs and add them manually, it works.
I don't know if this is related to React CSS Modules, Storybook or to the add-on 😕
Sure ! My whole code is accessible on this repo
I'm trying to create a complete boilerplate so don't hesitate if you just only the storybook + css-modules parts, I'll create another repo.
Activity
ndelangen commentedon Jan 23, 2018
Do you have a repo you can share for us to experiment on?
I've never used that combo of addons, or react-css-modules.
naomiHauret commentedon Jan 23, 2018
Sure ! My whole code is accessible on this repo
I'm trying to create a complete boilerplate so don't hesitate if you just only the storybook + css-modules parts, I'll create another repo.
Hypnosphi commentedon Jan 23, 2018
Seems related to storybookjs/storybook#2513 and storybookjs/storybook#1735
Hypnosphi commentedon Jan 23, 2018
You can try to attach PropTypes directly to exported component instead:
naomiHauret commentedon Jan 23, 2018
@Hypnosphi thanks for your help, it didn't do the trick though 😕 knobs still won't display with this technique.