Closed
Description
I haven't seen this anywhere in the documentation, and it definitely is not supported right now, but it would be great if the docs could inherit comments from objects who were spread into propTypes
(in the same file), like the following.
const propTypes = {
/* This does something. */
bar: PropTypes.node,
};
export default function Foo(props) {
return <div />;
}
Foo.propTypes = {
...propTypes,
};
Foo.defaultProps = {
bar: null,
};
This would support styleguide's like Airbnb: https://github.com/airbnb/javascript/tree/master/react#ordering