tuchk4 / storybook-readme

React Storybook addon to render README files in github style

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Props Table - Add Flow Type Support

Asymons opened this issue · comments

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.