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

Props Table - Add Flow Type Support #206

Open
Asymons opened this issue Aug 12, 2019 · 0 comments
Open

Props Table - Add Flow Type Support #206

Asymons opened this issue Aug 12, 2019 · 0 comments

Comments

@Asymons
Copy link

Asymons commented Aug 12, 2019

Hello!
I'm trying to use the flow with this project but I'm encountering the an issue where the Types column on the props table is set to other only. Default values and optionals seem to work fine on the contrary.

A workaround I've found is to include the prop-types library and inject the type information manually again; however, this isn't ideal. If you have any suggestions I'm open to them!

I should also add I'm using react-hooks additionally and for those unfamiliar with flow, the layout is as follows:

// @flow
import React from 'react';

type PropTypes = {
    text?: string,
}

const TextComponent = ({text}: PropTypes) => <div>{text}</div>

export default TextComponent;

There should be support if react-docgen is being used.

EDIT:
Seems like https://github.com/hipstersmoothie/storybook-addon-react-docgen#readme works.

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