@bebraw/extract-react-types
npm i @bebraw/extract-react-types

@bebraw/extract-react-types

One stop shop for documenting your react components.

by atlassian

0.16.2 (see all)License:Apache-2.0TypeScript:Not Found
npm i @bebraw/extract-react-types
Readme

extract-react-types

Extract Flow & TypeScript types from React Components

Features

  • Supports flow and typescript
  • Extracts the description of the props too ( Great for documentation )

Usage

$ yarn add extract-react-types
// Component.js

class Component extends React.Component<{ foo: boolean }> {}

Output:

{
  "kind": "program",
  "classes": [
    {
      "kind": "object",
      "members": [
      {
        "kind": "property",
        "key": {
        "kind": "id",
        "name": "foo"
        },
        "value": {
        "kind": "boolean"
        },
        "optional": false
      }
      ],
      "name": {
      "kind": "id",
      "name": "Component",
      "type": null
      }
    }
  ]
}

Downloads/wk

1

GitHub Stars

160

LAST COMMIT

1yr ago

MAINTAINERS

1

CONTRIBUTORS

29

OPEN ISSUES

18

OPEN PRs

5
VersionTagPublished
0.16.2
latest
3yrs ago
No alternatives found
No tutorials found
Add a tutorial