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

I cannot get it to work with flow #43

Closed
ghost opened this issue Feb 7, 2018 · 2 comments
Closed

I cannot get it to work with flow #43

ghost opened this issue Feb 7, 2018 · 2 comments

Comments

@ghost
Copy link

ghost commented Feb 7, 2018

This is my package.json

    "babel-plugin-react-docgen": "^1.8.2",
    "@storybook/addon-actions": "^3.3.12",
    "@storybook/addon-backgrounds": "^3.3.12",
    "@storybook/addon-info": "^3.3.12",
    "@storybook/addon-knobs": "^3.3.12",
    "@storybook/addon-links": "^3.3.12",
    "@storybook/addons": "^3.3.12",
    "@storybook/react": "^3.3.12",

babelrc

{
  "presets": ["env", "react"],
  "plugins": ["react-docgen", "transform-class-properties"]
}

Component

// @flow
import React, { type Node } from 'react'
type Props = {
  children: Node,
}

const Component = ({ children, vertical, horizontal }: Props) => (
  <div>
    {children}
  </div>
)

Component.displayName = 'Component'

export default Component

but Component.__docgenInfo is always undefined.

I am not sure what i am doing wrong.

@danielduan
Copy link
Member

danielduan commented Feb 12, 2018

I wonder if flow interferes with the AST parser that we use to determine if it's a react component or not. Sounds like this is an edge case we missed.

If you have time to open a PR, I'd really appreciate it.

@danielduan danielduan changed the title I cannot get it to work I cannot get it to work with flow Feb 26, 2018
@danielduan
Copy link
Member

v1.9.0 published with docgen@3.0-beta. clear your lock files, reinstall, and let me know if this doesn't fix the issue.

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