react-docgen
react-docgen copied to clipboard
A CLI and library to extract information from React component files for documentation generation purposes.
## Description In Typescript, it's possible to type a function using a [call signature](https://www.typescriptlang.org/docs/handbook/2/functions.html#call-signatures). For example, this is valid TS: ```ts interface A { foo: string; } type FnType =...
Reporting from https://github.com/storybookjs/storybook/pull/24165 Currently TS enums analysis is lossy: ```tsx enum ButtonType { Button = 'button', Reset = 'reset', Submit = 'submit', } type ButtonTestProps = { type?: ButtonType; };...
The following input: ``` import React, { forwardRef } from 'react'; interface ButtonProps { variant?: 'small' | 'large'; disabled?: boolean; children: React.ReactNode; } export const Button = forwardRef(function Button( {...
Hello together, with the following code the union type of name gets lost: ```ts interface FullProps { /** The name to greet */ name: "world" | "hello"; title: string; }...
We are using react-docgen to parse TypeScript component files and display their props and types in a documentation app. Our issue is that typing our parser code is not possible...
Methods in the following component is not recognised. It works if I remove the useCallback. ```jsx import React, { forwardRef, memo, useCallback, useImperativeHandle, useMemo, useRef, } from 'react'; export const...
Component comment blocks as well as proptype comments cannot be extracted with react docgen when using babel hermes-parser plugin https://www.npmjs.com/package/babel-plugin-syntax-hermes-parser. This parser is essential when running an application with flow...
I've been playing around with the latest beta, and while it works well for many cases, I could not get it to work with compound components. A compound component generally...
Sorry if this has been reported before in some form before, but is there currently support for nested type descriptions? For example, given the following structure (using [Flow](https://flow.org/en/) and `[email protected]`):...