Storybook: Prop descriptions from a Flow codebase does not show up in prop table

Created on 31 Dec 2019  路  8Comments  路  Source: storybookjs/storybook

Describe the bug
I expect that the comments above the props from a code base using Flow would show up in the prop table in Storybook.

To Reproduce
Steps to reproduce the behavior:

  1. Install code from https://github.com/lifeofmle/storybook-flow
  2. Run yarn install
  3. Run yarn storybook
  4. Open Docs panel of Button component

Expected behavior
I expect that the comments above the props would show up in the prop table in Storybook

Screenshots
Here is a screenshot of the Docs generated without the description from Flow props
image

Code snippets
I expect that the comments above the props would show up in the prop table in Storybook

type PropsType = {
  /**
   * Content of the button
   */
  children: ?Element<*>;
  /**
   * Specifies the width of the button. Default 100%
   */
  width: string;
  /**
   * What happens when you click on the button
   */
  onClick: () => void;
}

System:
Code available https://github.com/lifeofmle/storybook-flow

Assumption
Storybook book would read the props similar to how Styleguidist therefore the comments would be read and displayed

props question / support

All 8 comments

@lifeofmle Flow support didn't get added until 5.3. Try upgrading!

@shilman I have upgraded to 5.3.0-rc.6 and now I am getting unknown in the Description column.

image

@patricklafrance does @lifeofmle need to do something special for flow?

@shilman nope it should work out of the box.

Haven't test it thoroughly since we don't officially support flow.

Would need to test if it's a bug with react-docgen or if it's on Storybook end.

@patricklafrance @shilman With 5.3.0-rc.7 the props started working for my internal library that is using flow.

It still doesn't work with this demo project. I have no clue why.

I think it is safe to close this issue because it is working on my real code

Excellent! Closing this, and somebody can reopen if they hit it again 馃挴

@shilman what is included in rc.7? did you update react-docgen?

@patricklafrance Nope, that upgrade is still sitting in a PR. I'm guessing it was a node_modules issue in @lifeofmle 's repo?

Was this page helpful?
0 / 5 - 0 ratings