documentation
documentation copied to clipboard
Does this support PropTypes via Flow?
I've been enjoying this project thus far, but a recent PR has introduced React.PropTypes
via Flow.
A related project supports it, and I was trying to figure out if this one does or can:
https://github.com/reactjs/react-docgen#flow-type-support
Thanks!
If you use flow to define the type of the props you should be fine.
Adding support for reacts old propTypez API sound useful too. Maybe you could take a stab at it?
Going off of this example:
https://github.com/reactjs/react-docgen#example-1
import React, { Component } from 'react';
type Props = {
/** Description of prop "foo". */
primitive: number,
/** Description of prop "bar". */
literalsAndUnion: 'string' | 'otherstring' | number,
arr: Array<any>,
func?: (value: string) => void,
obj?: { subvalue: ?boolean },
};
/**
* General component description.
*/
export default class MyComponent extends Component<void, Props, void> {
props: Props;
render(): ?ReactElement {
// ...
}
}
documentation
renders:
How would you recommend this example be changed such that documentation
provides much more standard, useful output as seen in your examples?
Or would I want to run both of these projects together?
Any update on this?? I need to group proptypes with component. How can I do that?
what happens if you add the following:
@description - describes what it does