react-docgen
react-docgen copied to clipboard
A CLI and library to extract information from React component files for documentation generation purposes.
For functional components we can use `React.Config` to define default props: ```js import * as React from 'react'; type DefaultProps = $ReadOnly; type AllProps = $ReadOnly; type Props = React.Config;...
```js type Props = { children: React.Element, renderStatus?: () => React.Element }; function Test(props: Props, context) { if (context.show) { return props.renderStatus ? props.renderStatus() : null; } return props.children; }...
the input code ``` tsx import React from 'react'; import './button.css'; export interface ButtonProps { /** * Is this the principal call to action on the page? */ primary?: boolean;...
```jsx import * as React from 'react'; interface IProps { value: string; } export default class extends React.Component { render() { const { value } = this.props; return {value}; }...
Since hooks have been released a while back, it would be nice to be able to generate docs for them. For example, for a simple hook: ```js import {useState} from...
I have the following component `CheckBox`. Notice I have styled-components that I create in this file and use in this file: `Wrapper`, `Input`, and `Label`. I haven't seen a way...
Related to #458, but [TSDoc](https://github.com/microsoft/tsdoc) (a tool maintained by Miscrosoft) although influenced by JSDoc, has a strictly distinct syntax. For example, `@default` in JSDOC is `@defaultValue` in TSDOC. `@inheritDoc` doesn't...
Can't compiling a project. Node version 12.8.3 MacOS ce start of marking 21379 ms) (average mu = 0.126, current mu = 0.014[11116:0x102d4e000] 402874 ms: Mark-sweep 2035.9 (2056.5) -> 2029.4 (2054.0)...
In the README there is no mention of JSDoc and what subset of JSDoc syntax react-docgen supports. Would help to have some documentation explaining the usage with JSDoc.
Dear all, I'm struggling to find documentation about handling a case in which you're defining props in the arguments passed to a stateless, functional component, i.e. ES6 destructuring assignment syntax....