storybook-state icon indicating copy to clipboard operation
storybook-state copied to clipboard

Story source shows wrong info when addon is used

Open Dizotoff opened this issue 5 years ago • 4 comments

Whenever I use a storybook-state addon in my storybook, Story Source field shows information about the state instead of showing the info about the code.

Image of wrong output

Actual Story Source

.add(
    'Checkbox',
    withState({ checked: false })(({ store }) => (
      <Checkbox
        label={text('Label', 'Example label')}
        onChange={checked => store.set({ checked })}
        checked={store.state.checked}
        disabled={boolean('Disabled', false)}
        description={text('Description', 'Example description')}
      />
    ))
  );

Dizotoff avatar Jul 26 '19 10:07 Dizotoff

Any updates on this?

Kaivosukeltaja avatar Sep 10 '19 09:09 Kaivosukeltaja

Is there a fix or workaround for this?

azmi-mo avatar Nov 06 '19 03:11 azmi-mo

I'm also having the same issue...

daton89 avatar Dec 19 '19 13:12 daton89

Is there a fix or workaround for this?

You can use useState hook inside stories

Dizotoff avatar Jun 17 '20 08:06 Dizotoff