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

How to display state properties of a react component #3561

Closed
amittkSharma opened this issue May 9, 2018 · 5 comments
Closed

How to display state properties of a react component #3561

amittkSharma opened this issue May 9, 2018 · 5 comments

Comments

@amittkSharma
Copy link

amittkSharma commented May 9, 2018

Hello Team,

I am working with Storybook and using the info Addon for displaying the properties of the component in the story. And I wanted to display the state properties of the component too.

  1. Is there some way I can use the same addon to display the state properties of the component?
  2. Or there is some other addon I have to use for this purpose?

Thanks in advance.
Amit

@Keraito
Copy link
Contributor

Keraito commented May 13, 2018

Hey @amittkSharma, what properties of the state do you exactly want to display?

The reason that the addon-info can display the additional information of the properties of components is cuz they are statically defined. As far as I'm aware, that is rarely to not done for the state of react components. Or are you referring to different information?

@amittkSharma
Copy link
Author

Hi Keraito,

Thanks for the response, but the thing I am referring is some kind of state interface that a react component has? This will be useful for the user using the storybook to get the information that what kind of state a component will be maintaining.

Thanks
Amit

@wuweiweiwu
Copy link
Member

wuweiweiwu commented May 15, 2018

Hi @amittkSharma,

The info addon currently uses the parse tree via babel plugin to generate docs. However, state documentation is not supported unless you just want to use withInfo. Perhaps in the future we can support flow annotations on state type definitions.

@amittkSharma
Copy link
Author

Thanks, looking forward to the feature in the addon.

@wuweiweiwu
Copy link
Member

For now, if you want to document state it'll prob be just just to write it out. 👍

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

4 participants