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

Support flow type props validation #939

Closed
shilman opened this issue Apr 22, 2017 · 3 comments
Closed

Support flow type props validation #939

shilman opened this issue Apr 22, 2017 · 3 comments

Comments

@shilman
Copy link
Member

shilman commented Apr 22, 2017

Issue by joehua87
Saturday Sep 17, 2016 at 14:00 GMT
Originally opened as storybook-eol/react-storybook-addon-info#74


Thank you for your awesome library.

Did you have any plan to support:

export default class Item extends React.Component { // eslint-disable-line
  props: {
    icon: string,
    tooltip?: string,
    onClick?: () => void,
  };

  render() {
    const { icon, tooltip, onClick } = this.props
    return (
      <span className={styles.root} onMouseDown={onClick} title={tooltip}>
        <span className="material-icons">{icon}</span>
      </span>
    )
  }
}

together with

  static propTypes = {
    icon: React.PropTypes.string.isRequired,
    tooltip: React.PropTypes.string,
    onClick: React.PropTypes.func,
  };
@shilman
Copy link
Member Author

shilman commented Apr 22, 2017

Comment by MoOx
Wednesday Feb 01, 2017 at 10:38 GMT


https://github.com/styleguidist/react-styleguidist handle this using react-docgen. The problem is that for now it's limited to babel5 parser... Until this is fixed reactjs/react-docgen#125 / reactjs/react-docgen#137 (so this babel/babylon#278 / babel/babylon#277)

@ndelangen
Copy link
Member

I think we should move this issue to:
https://github.com/storybooks/babel-plugin-react-docgen

@ndelangen
Copy link
Member

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

No branches or pull requests

2 participants