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

ReferenceError: h is not defined #3448

Closed
yi-ge opened this issue Apr 19, 2018 · 0 comments
Closed

ReferenceError: h is not defined #3448

yi-ge opened this issue Apr 19, 2018 · 0 comments

Comments

@yi-ge
Copy link
Contributor

yi-ge commented Apr 19, 2018

I use @storybook/cli@4.0.0-alpha.3.

const styles = {
  textAlign: 'center',
};

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

storiesOf('Button', module)
  .addDecorator(CenterDecorator)
  .add('with text', () => ({
    components: { MyButton },
    template: '<my-button @click="action">Hello Button</my-button>',
    methods: { action: action('clicked') },
  }))
  .add('with JSX', () => ({
    components: { MyButton },
    render(h) {
      return <my-button onClick={this.action}>With JSX</my-button>;
    },
    methods: { action: linkTo('clicked') },
  }))

I get the error: ReferenceError: h is not defined.

If add h in render, it work. #3409

But on the addDecorator, I cant get the h.

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

1 participant