Skip to content

Wrong description on Decorators #1229

@MasahiroMorita

Description

@MasahiroMorita

In wiki page on storybook decorators, the example code is wrong:

const CenterDecorator = ({ children }) => (
  <div style={styles}>
    { children }
  </div>
);

storiesOf('Button', module)
  .addDecorator(CenterDecorator)
  .add('with text', () => (
    <Button onClick={action('clicked')}>Hello Button</Button>
  ))

this should be:

const CenterDecorator = (storyFn) => (
  <div style={styles}>
    { storyFn() }
  </div>
);

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions