You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Function (React component in this case) parameter types should be documented when the function is also a namespace with multiple definitions.
Actual Behavior
I have a React component defined as a plain function with its props defined in a namespace:
// This worksexportfunctionMyComponent(props: MyComponent.Props){const{ children }=props;return(<div>{children}</div>);}exportnamespaceMyComponent{exportinterfaceProps{children?: React.ReactNode;}}
This is processed as expected. However, as soon as I add prop-types declaration to the function, Typedoc throws a warning: [warning] MyComponent.Props, defined in ./src/index.tsx, is referenced by MyComponent.props but not included in the documentation.
// This doesn'timportPropTypesfrom'prop-types';exportfunctionMyComponent(props: MyComponent.Props){const{ children }=props;return(<div>{children}</div>);}exportnamespaceMyComponent{exportinterfaceProps{children?: React.ReactNode;}}MyComponent.propTypes={children: PropTypes.node,};
I suspect it may be caused by something failing to merge namespace definitions, as the resulting .d.ts looks like this:
Search terms
prop-types, namespace, react
Expected Behavior
Function (React component in this case) parameter types should be documented when the function is also a namespace with multiple definitions.
Actual Behavior
I have a React component defined as a plain function with its props defined in a namespace:
This is processed as expected. However, as soon as I add prop-types declaration to the function, Typedoc throws a warning: [warning] MyComponent.Props, defined in ./src/index.tsx, is referenced by MyComponent.props but not included in the documentation.
I suspect it may be caused by something failing to merge namespace definitions, as the resulting .d.ts looks like this:
This actually also fails if another namespace (non-type-only) is declared with the same name (so it's not specific to prop-types):
Steps to reproduce the bug
TypeStrong/typedoc-repros#50
Environment
The text was updated successfully, but these errors were encountered: